LemonStand XLemonade Stand by Michael Guy from ZX Computing Aug/Sep.1983 1:1:7 010 ,5;"Press 'ENTER' to begin":z$   5000 0l=0:m=1000:r=502:p=3  day=1 1000 ':>.97xQday>23000 1,2;"REPORT" &14,159:524,0 '" DAY ";day w$(6,18) w$(1)="cloudy" w$(2)="sunny" !w$(3)="rainy" "w$(4)="stormy" #w$(5)="HOT" $w$(6)="snowy" 'a$(6,18) ( a$(1,17)=60< ) a$(2,17)=80P * a$(3,17)=15 +a$(4,17)=7 ,!a$(5,17)=105i -a$(6,17)=2 2 a$(1,18)=40( 3 a$(2,18)=90Z 4 a$(3,18)=15 5 a$(4,18)=10 6!a$(5,18)=130 7a$(6,18)=8 dd=(*6+1) n+'" The weather today is ";w$(d,16) $'" Lemonade Costs ";p;"p. per cup" '" Total money=`";m/100d m<02000 120,0;" How many cups to be made? " c 6c>m/p12 ,0;" You haven't enough money" c>m/p170 712 ,0;" No. of cups made is ";c;" " 020,0;" Sale price for each cup? " l l>40(200 114,0;" Sale price=";l;"p. per cup" 502 520,0;" Press a key to open your stall" =""230 1000 t=9 $2,1;"TIME: ";t;":00 "  30  t=t+1 t=13 t=1 "t8260 ,.9 ,10 ;0;6;"CLOSED" 6 502 @+n=*(a$(d,17))+*(a$(d,18)) J%a=(n-(1/(10 -(l-p)))*n) KERROR NOTE: Line 330 is as printed in the magazine, but will give a "6 Number too big" error if the cost price is 10p less than the sale price, as it will try to divide 1 by 0. [JimG] T a>ca=c ^#:1,2;"SALES REPORT" h&14,159:98b,0 r'"No. of cups sold=";a |*''" Money in the till=`";(a*l)/100d )''" Wholesalers bill=`";(c*p)/100d ''" RENT=`";r/100d 1''" PROFIT FOR THE DAY=`";(l*a-c*p-r)/100d m=m+(l*a-c*p-r) m<02000 day=day+1 day=82500 >.6p=p+1 .20,0;" Press a key to continue" =""490  9  Graphic set-up  6:1 a=1521 8a,0;4;"" a 27,11 ;7;0;" LEMONADE " .6:8,8;"" $a=9 12 . a,9 ;"";a,22;"" 8a Ba=13 17 La,9 ;"" Va [ 9 ,10 ;" OPEN " `614,10 ;7;0;"PRICE=";l;"p." e 5 j%90Z,81Q:1,-9 t&98b,81Q:-1,-9 ~$90Z,81Q:8,0 a=72H78N 91[,a:6,0  5 a &105i,81Q:1,-9 '113q,81Q:-1,-9 %105i,81Q:8,0 a=72H78N 106j,a:6,0  5 a  30   200: !1,2;"FINAL REPORT" &14,159:99c,0 ?''" You lasted for ";day;" days, until you ran out of money" @'" You didn't do very well,and you are not a good shop-keeper" 420,0;" Press 'ENTER' for another go!"  =""2060   :5 200  !1,2;"FINAL REPORT" &14,159:99c,0 F''" You completed your week in business and made a profit of " /10 ,5;"Total money=`";m/100d %11 ,5;"minus float=`10" &39',79O:120x,0 :13 ,5;"PROFIT =`";(m/100d)-10 420,0;" Press 'ENTER' for another go!" =""2560 :5  :1 "1,2;"POLICE REPORT" '14,159:105i,0 l'''" The police have informed you that vandals have damaged your property. The cost of repairs is `20." d''" If you cannot meet this bill press 'Q'. If you want to carry on your business press 'ENTER'" ="q"6000p =""3060 m=m-2000  9 Instructions #1,9 ;"LEMONADE STAND" '70F,159:114r,0 ''" You have been placed in charge of a small lemonade stand in Hyde Park,London 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 be made? and At what price they should be sold at?"  '''" Press 'ENTER' to open." =""5070  p 200 z 1,2;"BROKE" &14,159:42*,0 "''" You finally ended up broke." R''" The police have just told you that the vandals are still on the loose." 420,0;" Press 'ENTER' for another go!" =""6070  4