Basic computer programming for beginners:
// This program is issued under the GPL (
en.wikipedia.org/wiki/GNU_General_Public_License) which allows everyone
// the freedom to study, run, share (copy) and modify the software. Copyright (C) X. Vororo, 2015.
WHILE (gilead-patents = true) DO
IF (patient-lives = europe OR patient-lives = america) THEN
IF (patient-fibrosis >= F3) THEN
treatment MIGHT BE AVAILABLE in national health system
GOTO GILEAD-HEAVEN // warning tickets $ 80 000 per head
ELSE
treatment NOT AVAILABLE in national health service
PAUSE
ENDIF
IF (patient-reads = "fixHepC") THEN
generic treatment AVAILABLE
ELSE
PAUSE
ENDIF
ELSE // (patient lives in low income country)
IF (patient-earns >= 10 *average-national-income) THEN
generic treatment AVAILABLE
ELSE
request bank loan
if (patient-loan = approved) THEN
generic treatment AVAILABLE
ELSE
PAUSE
ENDIF
ENDIF
ENDIF
DONE
Homework:
Q1. Easy. Explain in simple words the effect of the WHILE statement.
Q2. Medium. Replace each PAUSE statement by "SLEEP X" where X is the correct number of years based on Gilead's current patents.
Q3. Hard. Everyone knows that GOTO statements are dangerous in computer programs. Modify the above program to eliminate the nasty GOTO statement.
Q4. Advanced. Write a new program that does not use GOTO or PAUSE statements. Hint. You are allowed to change the unit price of the medicine and/or travel to a foreign country.