Home » Archimedes archive » Micro User » MU 1990-02.adf » C/GROCER

C/GROCER

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Micro User » MU 1990-02.adf
Filename: C/GROCER
Read OK:
File size: 0629 bytes
Load address: FFFFFB42
Exec address: 181D2800
Duplicates

There are 2 duplicate copies of this file in the archive:

File contents
   10MODE 7
   20PROCcopies
   30DIM Fruit$(12)
   40DIM Name$(10)
   50DIM Quest$(6)
   60 DIM Price(12)
   70QN=0
   80REPEAT
   90QN=QN+1
  100PROCSetup
  110PROCMessage
  120N=0
  130REPEAT
  140N=N+1
  150PROCinit
  160PROCprint
  170UNTIL N=13
  180UNTIL QN=QC
  190 
  200END
  210 
  220 
  230 
  240 
  250 
  260DEFPROCcopies
  270INPUT''"How many copies do you want? "QC
  280CLS
  290ENDPROC
  300 
  310DEFPROCSetup
  320FOR X=1 TO 12
  330 READ Fruit$(X)
  340 Price(X)=RND(20)
  350NEXT X
  360FOR Y=1 TO 10
  370 READ Name$(Y)
  380NEXT Y
  390FOR Z=1 TO 6
  400 READ Quest$(Z)
  410NEXT Z
  415RESTORE
  420ENDPROC
  430 
  440 
  450DEFPROCMessage
  451VDU2
  460PRINT TAB(10)QN;:PRINT TAB(65)QN
  470PRINT'"These are money problems."'"Read them carefully and answer them."''"THE GREENGROCER SHOP ----- PRICE LIST"'"-------------------------------------"
  475J=0
  480 FOR I=1 TO 6
  490 FOR H=1 TO 2
  495J=J+1
  500PRINT "A ";Fruit$(J);" costs ";Price(J);"p,   ";
  510NEXT H
  515PRINT'"";
  520NEXT I
  530PRINT
  531VDU3
  540ENDPROC
  550 
  560 
  570 
  580 
  590 
  600DEFPROCinit
  610 a=RND(12):b=RND(12):c=RND(12)
  620IF a=b OR a=c OR b=c THEN 610 ELSE 630
  630n=RND(10):q=RND(6)
  640Answer=Price(a)+Price(b)+Price(c)
  650ENDPROC
  660 
  670 
  680 
  690 
  700DEFPROCprint
  701VDU2
  710 PRINT Name$(n);" went shopping and bought a ";Fruit$(a);","
  720PRINT "a ";Fruit$(b);" and a ";Fruit$(c);"."
  730 PRINT Quest$(q);"  ________p";:PRINT TAB(65)Answer;"p"'
  732VDU3
  740ENDPROC
10000DATA Banana,Lemon,Melon,Pineapple
11000DATA "Kiwi Fruit",Pear,Peach,Mango
12000DATA Nectarine,Plum,"Bunch of Grapes",Lime
13000DATA Christopher,Katherine,Aimee,Douglas,Ruth
14000DATA James,Garth,Shony,Siobhan,Hayleigh
15000DATA "How much was spent in the greengrocers?"
15100 DATA "How much did it all cost?"
15200DATA "How much money would be needed to buy the fruit?"
15300DATA "How much was it altogether?"
15400DATA "What was the total cost?"
15500DATA "What was the total amount needed?"

� 7
�copies
� Fruit$(12)
(� Name$(10)
2� Quest$(6)
< � Price(12)
FQN=0
P�
ZQN=QN+1
d
�Setup
n�Message
xN=0
��
�	N=N+1
�	�init
�
�print
�
� N=13
�� QN=QC
� 
��
� 
� 
� 
� 
� 
��copies
(�''"How many copies do you want? "QC
�
"�
, 
6��Setup
@� X=1 � 12
J � Fruit$(X)
T Price(X)=�(20)
^� X
h� Y=1 � 10
r � Name$(Y)
|� Y
�
� Z=1 � 6
� � Quest$(Z)
�� Z
��
��
� 
� 
�
��Message
��2
�� �10)QN;:� �65)QN
֙�'"These are money problems."'"Read them carefully and answer them."''"THE GREENGROCER SHOP ----- PRICE LIST"'"-------------------------------------"
�J=0
� � I=1 � 6
� � H=1 � 2
�	J=J+1
�0� "A ";Fruit$(J);" costs ";Price(J);"p,   ";
�� H
	�'"";
� I
�
�3
�
& 
0 
: 
D 
N 
X
��init
b a=�(12):b=�(12):c=�(12)
l#� a=b � a=c � b=c � �DbB � �DvB
vn=�(10):q=�(6)
�%Answer=Price(a)+Price(b)+Price(c)
��
� 
� 
� 
� 
���print
��2
�< � Name$(n);" went shopping and bought a ";Fruit$(a);","
�,� "a ";Fruit$(b);" and a ";Fruit$(c);"."
�1 � Quest$(q);"  ________p";:� �65)Answer;"p"'
��3
��
'"� Banana,Lemon,Melon,Pineapple
*�#� "Kiwi Fruit",Pear,Peach,Mango
.�+� Nectarine,Plum,"Bunch of Grapes",Lime
2�.� Christopher,Katherine,Aimee,Douglas,Ruth
6�(� James,Garth,Shony,Siobhan,Hayleigh
:�/� "How much was spent in the greengrocers?"
:�" � "How much did it all cost?"
;`8� "How much money would be needed to buy the fruit?"
;�#� "How much was it altogether?"
<( � "What was the total cost?"
<�)� "What was the total amount needed?"
�
00000000  0d 00 0a 07 eb 20 37 0d  00 14 0b f2 63 6f 70 69  |..... 7.....copi|
00000010  65 73 0d 00 1e 10 de 20  46 72 75 69 74 24 28 31  |es..... Fruit$(1|
00000020  32 29 0d 00 28 0f de 20  4e 61 6d 65 24 28 31 30  |2)..(.. Name$(10|
00000030  29 0d 00 32 0f de 20 51  75 65 73 74 24 28 36 29  |)..2.. Quest$(6)|
00000040  0d 00 3c 10 20 de 20 50  72 69 63 65 28 31 32 29  |..<. . Price(12)|
00000050  0d 00 46 08 51 4e 3d 30  0d 00 50 05 f5 0d 00 5a  |..F.QN=0..P....Z|
00000060  0b 51 4e 3d 51 4e 2b 31  0d 00 64 0a f2 53 65 74  |.QN=QN+1..d..Set|
00000070  75 70 0d 00 6e 0c f2 4d  65 73 73 61 67 65 0d 00  |up..n..Message..|
00000080  78 07 4e 3d 30 0d 00 82  05 f5 0d 00 8c 09 4e 3d  |x.N=0.........N=|
00000090  4e 2b 31 0d 00 96 09 f2  69 6e 69 74 0d 00 a0 0a  |N+1.....init....|
000000a0  f2 70 72 69 6e 74 0d 00  aa 0a fd 20 4e 3d 31 33  |.print..... N=13|
000000b0  0d 00 b4 0b fd 20 51 4e  3d 51 43 0d 00 be 05 20  |..... QN=QC.... |
000000c0  0d 00 c8 05 e0 0d 00 d2  05 20 0d 00 dc 05 20 0d  |......... .... .|
000000d0  00 e6 05 20 0d 00 f0 05  20 0d 00 fa 05 20 0d 01  |... .... .... ..|
000000e0  04 0c dd f2 63 6f 70 69  65 73 0d 01 0e 28 e8 27  |....copies...(.'|
000000f0  27 22 48 6f 77 20 6d 61  6e 79 20 63 6f 70 69 65  |'"How many copie|
00000100  73 20 64 6f 20 79 6f 75  20 77 61 6e 74 3f 20 22  |s do you want? "|
00000110  51 43 0d 01 18 05 db 0d  01 22 05 e1 0d 01 2c 05  |QC......."....,.|
00000120  20 0d 01 36 0b dd f2 53  65 74 75 70 0d 01 40 0e  | ..6...Setup..@.|
00000130  e3 20 58 3d 31 20 b8 20  31 32 0d 01 4a 10 20 f3  |. X=1 . 12..J. .|
00000140  20 46 72 75 69 74 24 28  58 29 0d 01 54 13 20 50  | Fruit$(X)..T. P|
00000150  72 69 63 65 28 58 29 3d  b3 28 32 30 29 0d 01 5e  |rice(X)=.(20)..^|
00000160  07 ed 20 58 0d 01 68 0e  e3 20 59 3d 31 20 b8 20  |.. X..h.. Y=1 . |
00000170  31 30 0d 01 72 0f 20 f3  20 4e 61 6d 65 24 28 59  |10..r. . Name$(Y|
00000180  29 0d 01 7c 07 ed 20 59  0d 01 86 0d e3 20 5a 3d  |)..|.. Y..... Z=|
00000190  31 20 b8 20 36 0d 01 90  10 20 f3 20 51 75 65 73  |1 . 6.... . Ques|
000001a0  74 24 28 5a 29 0d 01 9a  07 ed 20 5a 0d 01 9f 05  |t$(Z)..... Z....|
000001b0  f7 0d 01 a4 05 e1 0d 01  ae 05 20 0d 01 b8 05 20  |.......... .... |
000001c0  0d 01 c2 0d dd f2 4d 65  73 73 61 67 65 0d 01 c3  |......Message...|
000001d0  06 ef 32 0d 01 cc 16 f1  20 8a 31 30 29 51 4e 3b  |..2..... .10)QN;|
000001e0  3a f1 20 8a 36 35 29 51  4e 0d 01 d6 99 f1 27 22  |:. .65)QN.....'"|
000001f0  54 68 65 73 65 20 61 72  65 20 6d 6f 6e 65 79 20  |These are money |
00000200  70 72 6f 62 6c 65 6d 73  2e 22 27 22 52 65 61 64  |problems."'"Read|
00000210  20 74 68 65 6d 20 63 61  72 65 66 75 6c 6c 79 20  | them carefully |
00000220  61 6e 64 20 61 6e 73 77  65 72 20 74 68 65 6d 2e  |and answer them.|
00000230  22 27 27 22 54 48 45 20  47 52 45 45 4e 47 52 4f  |"''"THE GREENGRO|
00000240  43 45 52 20 53 48 4f 50  20 2d 2d 2d 2d 2d 20 50  |CER SHOP ----- P|
00000250  52 49 43 45 20 4c 49 53  54 22 27 22 2d 2d 2d 2d  |RICE LIST"'"----|
00000260  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000280  2d 22 0d 01 db 07 4a 3d  30 0d 01 e0 0e 20 e3 20  |-"....J=0.... . |
00000290  49 3d 31 20 b8 20 36 0d  01 ea 0e 20 e3 20 48 3d  |I=1 . 6.... . H=|
000002a0  31 20 b8 20 32 0d 01 ef  09 4a 3d 4a 2b 31 0d 01  |1 . 2....J=J+1..|
000002b0  f4 30 f1 20 22 41 20 22  3b 46 72 75 69 74 24 28  |.0. "A ";Fruit$(|
000002c0  4a 29 3b 22 20 63 6f 73  74 73 20 22 3b 50 72 69  |J);" costs ";Pri|
000002d0  63 65 28 4a 29 3b 22 70  2c 20 20 20 22 3b 0d 01  |ce(J);"p,   ";..|
000002e0  fe 07 ed 20 48 0d 02 03  09 f1 27 22 22 3b 0d 02  |... H.....'"";..|
000002f0  08 07 ed 20 49 0d 02 12  05 f1 0d 02 13 06 ef 33  |... I..........3|
00000300  0d 02 1c 05 e1 0d 02 26  05 20 0d 02 30 05 20 0d  |.......&. ..0. .|
00000310  02 3a 05 20 0d 02 44 05  20 0d 02 4e 05 20 0d 02  |.:. ..D. ..N. ..|
00000320  58 0a dd f2 69 6e 69 74  0d 02 62 1c 20 61 3d b3  |X...init..b. a=.|
00000330  28 31 32 29 3a 62 3d b3  28 31 32 29 3a 63 3d b3  |(12):b=.(12):c=.|
00000340  28 31 32 29 0d 02 6c 23  e7 20 61 3d 62 20 84 20  |(12)..l#. a=b . |
00000350  61 3d 63 20 84 20 62 3d  63 20 8c 20 8d 44 62 42  |a=c . b=c . .DbB|
00000360  20 8b 20 8d 44 76 42 0d  02 76 12 6e 3d b3 28 31  | . .DvB..v.n=.(1|
00000370  30 29 3a 71 3d b3 28 36  29 0d 02 80 25 41 6e 73  |0):q=.(6)...%Ans|
00000380  77 65 72 3d 50 72 69 63  65 28 61 29 2b 50 72 69  |wer=Price(a)+Pri|
00000390  63 65 28 62 29 2b 50 72  69 63 65 28 63 29 0d 02  |ce(b)+Price(c)..|
000003a0  8a 05 e1 0d 02 94 05 20  0d 02 9e 05 20 0d 02 a8  |....... .... ...|
000003b0  05 20 0d 02 b2 05 20 0d  02 bc 0b dd f2 70 72 69  |. .... ......pri|
000003c0  6e 74 0d 02 bd 06 ef 32  0d 02 c6 3c 20 f1 20 4e  |nt.....2...< . N|
000003d0  61 6d 65 24 28 6e 29 3b  22 20 77 65 6e 74 20 73  |ame$(n);" went s|
000003e0  68 6f 70 70 69 6e 67 20  61 6e 64 20 62 6f 75 67  |hopping and boug|
000003f0  68 74 20 61 20 22 3b 46  72 75 69 74 24 28 61 29  |ht a ";Fruit$(a)|
00000400  3b 22 2c 22 0d 02 d0 2c  f1 20 22 61 20 22 3b 46  |;","...,. "a ";F|
00000410  72 75 69 74 24 28 62 29  3b 22 20 61 6e 64 20 61  |ruit$(b);" and a|
00000420  20 22 3b 46 72 75 69 74  24 28 63 29 3b 22 2e 22  | ";Fruit$(c);"."|
00000430  0d 02 da 31 20 f1 20 51  75 65 73 74 24 28 71 29  |...1 . Quest$(q)|
00000440  3b 22 20 20 5f 5f 5f 5f  5f 5f 5f 5f 70 22 3b 3a  |;"  ________p";:|
00000450  f1 20 8a 36 35 29 41 6e  73 77 65 72 3b 22 70 22  |. .65)Answer;"p"|
00000460  27 0d 02 dc 06 ef 33 0d  02 e4 05 e1 0d 27 10 22  |'.....3......'."|
00000470  dc 20 42 61 6e 61 6e 61  2c 4c 65 6d 6f 6e 2c 4d  |. Banana,Lemon,M|
00000480  65 6c 6f 6e 2c 50 69 6e  65 61 70 70 6c 65 0d 2a  |elon,Pineapple.*|
00000490  f8 23 dc 20 22 4b 69 77  69 20 46 72 75 69 74 22  |.#. "Kiwi Fruit"|
000004a0  2c 50 65 61 72 2c 50 65  61 63 68 2c 4d 61 6e 67  |,Pear,Peach,Mang|
000004b0  6f 0d 2e e0 2b dc 20 4e  65 63 74 61 72 69 6e 65  |o...+. Nectarine|
000004c0  2c 50 6c 75 6d 2c 22 42  75 6e 63 68 20 6f 66 20  |,Plum,"Bunch of |
000004d0  47 72 61 70 65 73 22 2c  4c 69 6d 65 0d 32 c8 2e  |Grapes",Lime.2..|
000004e0  dc 20 43 68 72 69 73 74  6f 70 68 65 72 2c 4b 61  |. Christopher,Ka|
000004f0  74 68 65 72 69 6e 65 2c  41 69 6d 65 65 2c 44 6f  |therine,Aimee,Do|
00000500  75 67 6c 61 73 2c 52 75  74 68 0d 36 b0 28 dc 20  |uglas,Ruth.6.(. |
00000510  4a 61 6d 65 73 2c 47 61  72 74 68 2c 53 68 6f 6e  |James,Garth,Shon|
00000520  79 2c 53 69 6f 62 68 61  6e 2c 48 61 79 6c 65 69  |y,Siobhan,Haylei|
00000530  67 68 0d 3a 98 2f dc 20  22 48 6f 77 20 6d 75 63  |gh.:./. "How muc|
00000540  68 20 77 61 73 20 73 70  65 6e 74 20 69 6e 20 74  |h was spent in t|
00000550  68 65 20 67 72 65 65 6e  67 72 6f 63 65 72 73 3f  |he greengrocers?|
00000560  22 0d 3a fc 22 20 dc 20  22 48 6f 77 20 6d 75 63  |".:." . "How muc|
00000570  68 20 64 69 64 20 69 74  20 61 6c 6c 20 63 6f 73  |h did it all cos|
00000580  74 3f 22 0d 3b 60 38 dc  20 22 48 6f 77 20 6d 75  |t?".;`8. "How mu|
00000590  63 68 20 6d 6f 6e 65 79  20 77 6f 75 6c 64 20 62  |ch money would b|
000005a0  65 20 6e 65 65 64 65 64  20 74 6f 20 62 75 79 20  |e needed to buy |
000005b0  74 68 65 20 66 72 75 69  74 3f 22 0d 3b c4 23 dc  |the fruit?".;.#.|
000005c0  20 22 48 6f 77 20 6d 75  63 68 20 77 61 73 20 69  | "How much was i|
000005d0  74 20 61 6c 74 6f 67 65  74 68 65 72 3f 22 0d 3c  |t altogether?".<|
000005e0  28 20 dc 20 22 57 68 61  74 20 77 61 73 20 74 68  |( . "What was th|
000005f0  65 20 74 6f 74 61 6c 20  63 6f 73 74 3f 22 0d 3c  |e total cost?".<|
00000600  8c 29 dc 20 22 57 68 61  74 20 77 61 73 20 74 68  |.). "What was th|
00000610  65 20 74 6f 74 61 6c 20  61 6d 6f 75 6e 74 20 6e  |e total amount n|
00000620  65 65 64 65 64 3f 22 0d  ff                       |eeded?"..|
00000629