DIM DAY$(1 TO 7) ' Make an array of seven strings LET DAY$(1) = "Monday" ' Make "Monday" the first item LET DAY$(2) = "Tuesday" ' Make "Tuesday" the second item PRINT "The day is", DAY$(1) ' Print out the first item. PRINT "The next day is", DAY$(2) ' Print out the second item. END
You can change the data in an array. For example, the following program changes the first item of the array:
DIM DAY$(1 TO 7) ' Make an array of seven strings LET DAY$(1) = "Monday" ' Make "Monday" the first item PRINT "The day is", DAY$(1) ' Print out the first item. LET DAY$(1) = "Manic Monday" ' Change the first item to "Manic Monday" PRINT "The day is", DAY$(1) ' Print out the first item. END
When the program runs, it will print out:
The day is Monday The day is Manic Monday
Fill in the blanks of the following program so that the
array DAY$
is filled with the days of the week, in order:
DIM DAY$(1 TO 7) ' Make an array of seven strings LET DAY$(1) = "Monday" ' Make "Monday" the first item LET DAY$( _____ ) = _________ LET DAY$( _____ ) = _________ LET DAY$( _____ ) = _________ LET DAY$( _____ ) = _________ LET DAY$( _____ ) = _________ LET DAY$( _____ ) = _________ END