{ arrays.p Started by Jeff Ondich on 1/20/97 Last modified 1/20/97 This is a very brief introduction to arrays. We'll be talking a lot more about this on Wednesday in class. Read sections 13.1 and 13.2 from the book by then. 1. Read the program, try to make sense of it, and then run it. 2. Write some code to compute the sum of the five integers typed by the user. Put your code somewhere after the *****. That is, don't compute the sum at the same time the numbers are being read, even though it would be convenient to do so. 3. Try to compute and report the largest number typed by the user. 4. String variables are really just arrays of characters. See if you can do this: ask the user for his/her name, then print it out backwards. } program arrays(input,output); type intarray = array[1..100] of integer; var theNumbers : intarray; i : integer; begin write( 'Type 5 integers separated by spaces: ' ); for i := 1 to 5 do read( theNumbers[i] ); {*****} writeln( 'Here is your third number: ', theNumbers[3] ); writeln( 'Here are your numbers, in reverse order: ' ); for i := 5 downto 1 do write( theNumbers[i] ); writeln; writeln( 'I''m going to double all of your numbers now' ); for i := 1 to 5 do theNumbers[i] := 2 * theNumbers[i]; writeln( 'Here they are' ); for i := 1 to 5 do write( theNumbers[i] ); writeln end.