Turing Array Assignments

Be sure to read the Turing Arrays resource before completing these assignments

Array01 — Random Numbers

Write a program that creates 10 random numbers between 1 and 100 in an array named "num".  Use a for loop to create the random numbers, then a second for loop to print the numbers.  Save as Array01.t.

Array02 — Hi-Lo Guesses

Write a "hi-lo" guessing game where the user has to guess a random number between 1 and 100. Store the guesses in an array named "guess".  Print the guesses after the user has guessed the correct number. Save as Array02.t.

Array03 — Prime Array

Write a program that determines all prime numbers below 1000 and stores them in an array named "prime". After the prime numbers have been determined, prompt for a number between 1 and n, where n is the number of prime numbers found. Use the array to print the nth prime number. Save as Array03.t.

Array04 — Backwards Name

Write a program that prompts for your first name and stores each letter in an array named "letter". Use the array to print the name backwards using a for loop. Save as Array04.t.

Array05 — Rainfall Array

Create an array named "month" and initialize the elements with "Jan", "Feb", etc. to "Dec". Use a for loop to prompt for the monthly rainfall for each of the months, then use a second for loop to print a report of the monthly rainfall. If a month's rainfall is in the top 3 rainfall months, append a short "bring an umbrella" note beside the month.

 

Below this report, print the month with the least rainfall (with the amount), the month with the most rainfall (with the amount), the average rainfall, and the total (annual) rainfall. Save as Array05.t.