06-23-2006, 01:11 AM
I am trying to create an array to store string values for 12 days. I then want to ask the user how many days they would like to purchase items for and display the items for each of the days up to the number inputed.
here is what i have so far. any help would be greatly appreciated.
here is what i have so far. any help would be greatly appreciated.
Code:
DIM n AS INTEGER
DIM day AS INTEGER
DIM items$(12)
items$(1) = "Partridge in a pear tree"
items$(2) = "Turtledove"
items$(3) = "French hen"
items$(4) = "Calling bird"
items$(5) = "Gold ring"
items$(6) = "Geese-a-laying"
items$(7) = "Swan-a-swimming"
items$(8) = "Maid-a-milking"
items$(9) = "Lady dancing"
items$(10) = "Lord-a-leaping"
items$(11) = "Piper piping"
items$(12) = "Drummer drumming"
CLS
1 PRINT "Enter amount of item to buy": INPUT day
IF day < 1 THEN
PRINT "Surely you can afford 1 day!"
SLEEP 7
GOTO 1
ELSEIF day > 12 THEN
PRINT "Don't be greedy!"
SLEEP 7
GOTO 1
END IF
FOR n = 1 TO day
PRINT items$
n = n + 1
NEXT
END