Lemonade Stand

Date: 1984
Type: Program
Platform(s): TS 2068

You have been placed in charge of a small lemonade stand at College and Yonge for a week. You start off with $10 in your pocket and you should try to make as much money as possible.

You are given the report for the day and you only need to make two decisions: How many cups to prepare, and For how much should each be sold?

Appears on

Library tape of the Indiana Sinclair Timex User’s Group.

Source Code

   10 REM From Personal Software          Spring 1984   Page 78
   20 BORDER 1: PAPER 1: INK 7: CLS 
   30 PRINT AT 10,5;"Press 'ENTER' to begin": INPUT z$
   40 CLS 
   50 GO SUB 1410
   60 LET l=0: LET m=1000: LET r=50: LET p=3
   70 LET day=1
   80 GO SUB 780
   90 CLS : IF RND>.97 AND day>2 THEN GO TO 1320
  100 PRINT AT 1,2;"REPORT"
  110 PLOT 14,159: DRAW 52,0
  120 PRINT '"  DAY ";day
  130 DIM w$(6,18)
  140 LET w$(1)="cloudy"
  150 LET w$(2)="sunny"
  160 LET w$(3)="rainy"
  170 LET w$(4)="stormy"
  180 LET w$(5)="hot"
  190 LET w$(6)="snowy"
  200 DIM a$(6,18)
  210 LET a$(1,17)=CHR$ 60
  220 LET a$(2,17)=CHR$ 80
  230 LET a$(3,17)=CHR$ 15
  240 LET a$(4,17)=CHR$ 7
  250 LET a$(5,17)=CHR$ 105
  260 LET a$(6,17)=CHR$ 2
  270 LET a$(1,18)=CHR$ 40
  280 LET a$(2,18)=CHR$ 90
  290 LET a$(3,18)=CHR$ 15
  300 LET a$(4,18)=CHR$ 10
  310 LET a$(5,18)=CHR$ 130
  320 LET a$(6,18)=CHR$ 8
  330 LET d=INT (RND*6+1)
  340 PRINT '" The weather today is ";w$(d, TO 16)
  350 PRINT '" Lemonade costs ";p;" cents/cup"
  360 PRINT '" Total money = $";m/100
  370 IF m<0 THEN GO TO 1110
  380 PRINT AT 20,0;" How many cups to be made? "
  390 INPUT c
  400 IF c>m/p THEN PRINT AT 12,0;"You haven't enough money"
  410 IF c>m/p THEN GO TO 390
  420 PRINT AT 12,0;" No. of cups made is ";c;"        "
  430 PRINT AT 20,0;" Sale price for each cup? "
  440 INPUT l
  450 IF l>40 THEN GO TO 440
  460 PRINT AT 14,0;" Sale price=";l;"c";CHR$ 8; OVER 1;"/"; OVER 0;" per cup "
  470 PAUSE 50
  480 PRINT AT 20,0;"Press any key to open your shop "
  490 IF INKEY$="" THEN GO TO 490
  500 GO SUB 780
  510 LET t=9
  520 PRINT AT 2,1;"Time: ";t;"  o'clock  "
  530 PAUSE 30
  540 LET t=t+1
  550 IF t=13 THEN LET t=1
  560 IF t<>8 THEN GO TO 520
  570 PRINT AT 9,10; PAPER 0; INK 6;" CLOSED "
  580 PAUSE 50
  590 LET n=RND*CODE (a$(d,17))+RND*CODE (a$(d,18))
  600 LET a=INT (n-(1/(10-(l-p)))*n)
  610 IF a>c THEN LET a=c
  620 CLS : PRINT AT 1,2;"SALES REPORT";AT 1,25;"Day ";day
  630 PLOT 14,159: DRAW 98,0
  640 PRINT '" No. of cups sold=";a
  650 PRINT '" Money in the till=$";(a*l)/100
  660 PRINT ''" Wholesalers bill=$";(c*p)/100
  670 PRINT ''" Rent=$";r/100
  680 PRINT ''" PROFIT FOR THE DAY=$";(l*a-c*p-r)/100
  690 LET m=m+(l*a-c*p-r)
  700 IF m<0 THEN GO TO 1110
  710 LET day=day+1
  720 IF day=8 THEN GO TO 1190
  730 IF RND>.6 THEN LET p=p+1
  740 PRINT AT 20,0;"  Press any key to continue     "
  750 IF INKEY$="" THEN GO TO 750
  760 GO TO 80
  770 STOP 
  780 REM ------- graphics
  790 CLS 
  800 BORDER 6: PAPER 1
  810 FOR a=15 TO 21
  820 PRINT AT a,0; INK 4;"\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::"
  830 NEXT a
  840 PRINT AT 7,11; PAPER 7; INK 0;" LEMONADE "
  850 INK 6: PRINT AT 8,8;"\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::\::"
  860 FOR a=9 TO 12
  870 PRINT AT a,9;"\::";AT a,22;"\::"
  880 NEXT a
  890 FOR a=13 TO 17
  900 PRINT AT a,9;"\::\::\::\::\::\::\::\::\::\::\::\::\::\::"
  910 NEXT a
  920 PRINT AT 9,10;" OPEN "
  930 PRINT AT 14,10; PAPER 7; INK 0;"PRICE=";l;"c";CHR$ 8; OVER 1;"/"; OVER 0
  940 INK 5
  950 PLOT 90,81: DRAW 1,-9
  960 PLOT 98,81: DRAW -1,-9
  970 PLOT 90,81: DRAW 8,0
  980 FOR a=72 TO 78
  990 PLOT 91,a: DRAW 6,0
 1000 PAUSE 5
 1010 NEXT a
 1020 PLOT 105,81: DRAW 1,-9
 1030 PLOT 113,81: DRAW -1,-9
 1040 PLOT 105,81: DRAW 8,0
 1050 FOR a=72 TO 78
 1060 PLOT 106,a: DRAW 6,0
 1070 PAUSE 5
 1080 NEXT a
 1090 PAUSE 30
 1100 RETURN 
 1110 PAUSE 200: CLS 
 1120 PRINT AT 1,2;"FINAL REPORT"
 1130 PLOT 14,159: DRAW 99,0
 1140 PRINT ''" You lasted for ";day;" days, until  you ran out of money"
 1150 PRINT '" You didn't do very well, as youfailed as a successful shop     keeper"
 1160 PRINT AT 20,0;" Press 'ENTER' for another try!"
 1170 IF INKEY$="" THEN GO TO 1170
 1180 CLS : GO TO 40
 1190 PAUSE 200
 1200 CLS 
 1210 PRINT AT 1,2;"FINAL REPORT"
 1220 PLOT 14,159: DRAW 99,0
 1230 PRINT ''"   You completed your week in    business and made a profit of "
 1240 PRINT AT 10,5;"Total money=$";m/100
 1250 PRINT AT 11,5;"minus loan of $10"
 1260 PLOT 39,79: DRAW 136,0
 1270 PRINT AT 13,5;"PROFIT     =$";(m/100)-10
 1280 PRINT AT 20,0;" Press 'ENTER' for another try!"
 1290 IF INKEY$="" THEN GO TO 1290
 1300 CLS : GO TO 40
 1310 STOP 
 1320 CLS : BORDER 1
 1330 PRINT AT 1,2;"POLICE REPORT"
 1340 PLOT 14,159: DRAW 105,0
 1350 PRINT '''" The police have informed you   that vandals have damaged your  property. The cost of repairs is$20.00."
 1360 PRINT ''" If you cannot meet this bill   press 'Q'. If you want to carry on your business press 'ENTER'."
 1370 IF INKEY$="q" THEN GO TO 1490
 1380 IF INKEY$="" THEN GO TO 1380
 1390 LET m=m-2000
 1400 GO TO 80
 1410 REM -------instructions
 1420 PRINT AT 1,9;"LEMONADE STAND"
 1430 PLOT 70,159: DRAW 114,0
 1440 PRINT ''" You have been placed in charge of a small lemonade stand at    College and Yonge for a week.   You start off with $10 in your  pocket and you should try to    make as much money as possible."
 1450 PRINT '" You are given the report for   the day and you only need to    make two decisions:             How many cups to prepare, and   For how much should each be     sold ?"
 1460 PRINT '''"  Press 'ENTER' to begin"
 1470 IF INKEY$="" THEN GO TO 1470
 1480 RETURN 
 1490 PAUSE 200
 1500 CLS 
 1510 PRINT AT 1,2;"BROKE"
 1520 PLOT 14,159: DRAW 42,0
 1530 PRINT ''" You finally ended up broke!"
 1540 PRINT ''" The police have just told you  that the vandals are still on   the loose."
 1550 PRINT AT 20,0;" Press 'ENTER' for another try!"
 1560 IF INKEY$="" THEN GO TO 1560
 1570 GO TO 30
 1580 SAVE "lemonade" LINE 1

People

No people associated with this content.

Scroll to Top