Works out a puzzle from the Ask Marilyn column (Parade Magazine, June 7, 1992): you make $10,000 a year; would you rather have a $1000 raise at the end of each year or a $300 raise at the end of each six months? Choose 1 or 2 and it prints a ten-year table, 1992 to 2001, of the salary under each plan, then tells you whether you chose well. The $300 plan wins every year (10300 against 10000 in the first year, 21100 against 19000 in the tenth).
Dick Wagner wrote two versions and both are in the download: the first reads the figures from DATA statements, the second (SALARY2) works them out with a formula. Corrected: in the formula version the year column was printed as 1992+n, which counted 1992, 1994 and so on to 2010 because the loop runs n=0 TO 18 STEP 2; it now prints 1992+n/2, so both versions show 1992 to 2001 with the same salaries.
Published in The Plotter July 1992 (Salary Raise).
Source Code
5 REM DICK WAGNER FOR THE PLOTTER 6/10/92
10 REM ASK MARILYN, OREGONIAN PARADE MAGAZINE JUNE 7, 1992
20 PRINT "YOU MAKE $10,000 A YEAR. YOU CANHAVE A $1000 RAISE AT THE END OFEACH YEAR,";
30 PRINT " OR YOU CAN HAVE A $300 RAISE AT THE END OF EACH 6 MONTHS."
40 PRINT : PRINT "WHICH DO YOU CHOOSE? 1 OR 2? "
45 PRINT : PRINT "1. $1000 AT END OF EACH YEAR 2. $300 AT THE END OF EACH 1/2 YEAR"
47 INPUT D: CLS
50 REM RUN A TEST FOR 10 YEARS, STARTING WITH 1992
90 PRINT AT 0,0;"YEAR";AT 0,8;"SALARY";AT 0,20;"SALARY";AT 1,6;"$300 RAISE";AT 1,18;"$1000 RAISE";AT 2,7;"END EACH";AT 2,20;"END EACH";AT 3,7;"6 MONTHS";AT 3,20;"12 MONTHS"
95 PRINT
100 FOR n=0 TO 9
110 LET s=10000
120 READ a
125 READ b
130 READ c
135 PRINT 1992+n;TAB 8;s+(a+b);TAB 20;s+c
140 NEXT n
150 DATA 0,300,0,600,900,1000,1200,1500,2000,1800,2100,3000,2400,2700,4000,3000,3300,5000,3600,3900,6000,4200,4500,7000,4800,5100,8000,5400,5700,9000
200 IF D=1 THEN PRINT : PRINT "You selected a raise of $1000 atthe end of each year."
210 IF D=1 THEN PRINT : PRINT "So you lost on that one!"
220 PRINT : IF D=2 THEN PRINT "You selected a raise of $300 at the end of each half year."
230 PRINT : IF D=2 THEN PRINT "You will win for a long time on that choice."
Formula version:
5 REM DICK WAGNER FOR THE PLOTTER 6/10/92
10 REM ASK MARILYN, OREGONIAN PARADE MAGAZINE JUNE 7, 1992
20 PRINT "YOU MAKE $10,000 A YEAR. YOU CANHAVE A $1000 RAISE AT THE END OFEACH YEAR,";
30 PRINT " OR YOU CAN HAVE A $300 RAISE AT THE END OF EACH 6 MONTHS."
40 PRINT : PRINT "WHICH DO YOU CHOOSE?1 OR 2? "
45 PRINT : PRINT "1. $1000 AT END OF EACH YEAR 2. $300 AT THE END OF EACH 1/2 YEAR"
47 INPUT A: CLS
50 REM RUN A TEST FOR 10 YEARS, STARTING WITH 1992
90 PRINT AT 0,0;"YEAR";AT 0,8;"SALARY";AT 0,20;"SALARY";AT 1,6;"$300 RAISE";AT 1,18;"$1000 RAISE";AT 2,7;"END EACH";AT 2,20;"END EACH";AT 3,7;"6 MONTHS";AT 3,20;"12 MONTHS"
95 PRINT
100 FOR n=0 TO 18 STEP 2
110 LET s=10000
135 PRINT 1992+n/2;TAB 8;s+600*n+300;TAB 20;s+1000*n/2
140 NEXT n
200 IF A=1 THEN PRINT : PRINT "You selected a raise of $1000 atthe end of each year."
210 IF A=1 THEN PRINT : PRINT "So you lost on that one!"
220 PRINT : IF A=2 THEN PRINT "You selected a raise of $300 at the end of each half year."
230 PRINT : IF A=2 THEN PRINT "You will win for a long time on that choice!"Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.



