Part 1:
Write a program that prompts the user for three numbers;
a) The number of random numbers to generate
b) The lowest number in the desired range
c) The highest number in the desired range
Your program will then create an array of the appropriate size, and fill it with random numbers in the desired range.
Print out the array.
Write a loop to calculate the sum of the array. Print out the sum and the average value.
Write another loop to print out every other value.
Part 2:
After the array is filled, write a loop to calculate
__ The sum of the even numbers in the array
__ The sum of all the numbers in the array that are less than the average value
__ The product of every third element
Part 3:
Add a user entry loop at the end of the program that asks the user for a number, and then prints the number that is stored at that location in the array. Also print the square and the square root of the number. The user entry loop should end when the user types “Exit” (case insensitive).
1
Expert's answer
2011-03-16T11:24:06-0400
Unfortunately, your question requires more work than to be done for free. You can submit it as an assignment to our control panel set the deadline and our programmers will assist you.
Comments
Leave a comment