! ************************** ! For C2: ! Prints input sentences backwards ! Not the most direct way, I admit ! Strategy: ! Read in a sentence from the keyboard ! Split the sentence up into letters, stored in the array letters$ ! Print the array backwards ! Input: ! Sentences from keyboard ! Program asks for more until user inputs a bare period [Put statement here that defines the array called letters$, with an extent of 1000] DO INPUT PROMPT "Type in a sentence or just a period to quit: ": sentence$ IF sentence$ = "." THEN EXIT DO LET length_of_sentence = Len(sentence$) FOR position = 1 TO Len(sentence$) LET letter$ = sentence$[position:position] [Assign letter$ to an element in the array letters$] NEXT position FOR [fill in this part] STEP -1 LET letter$ = [fill in this part] PRINT letter$; NEXT [fill in this part] PRINT LOOP END ! ************************** ! For D1: SUB Print_table_integers(array(,)) ! The internal parentheses warns the compiler ! what kind of array to expect ! Prints a two-dimensional array ! Presumes the first dimension gives rows and the second dimension gives columns ! Presumes array holds positive integers no bigger than 999 ! Presumes nothing about the extent of the arrays: ! Lbound(array,n) gives the lower bound of the nth dimension ! Ubound(array,n) gives the upper bound of the nth dimension FOR j = Lbound(array,2) TO Ubound(array,2) FOR i = Lbound(array,1) TO Ubound(array,1) PRINT Using$("####", array(i,j)); NEXT I PRINT NEXT j END SUB