An Array Work-Out Program You are to write a program that will manipulate an arr
ID: 3537762 • Letter: A
Question
An Array Work-Out Program
You are to write a program that will manipulate an array. Your program should handle up to 100 integer numbers. Declare the array as a global variable.
For each print out produced below, label the results. Also print your output in the order listed below.
For each part below, write a function (there are a number of functions).
_____________________________
Read in the values into the array. The last value is a 0 and is NOT one of the values to be used in any calculation below. The input is found in arraynum file.
Print out all the values in the array with no more than 10 numbers per output line.
Print out the average of the numbers.
Print out how many numbers are larger than the average and how many are smaller than the average. Pass average as a parameter.
Print out the average for the first half of the numbers in the array.
Print out the average for the last half of the numbers in the array.
For every odd location in the array, subtract it from the previous even location and store results in the even location. Print out all values in the array (a previous requirement)
Print out the average for the new array.
Sort the array and print out the sorted array.
Convert every negative number to a random number between 0 and 100. Print out the array.
Sort the array and print out the sorted array.
Print out the average for the new array.
*********************************************************************************************************
I have not attached the arraynum file, as that I didn't know how to list it here outside of listing the entire number file as text. So I have included the file below..
24 -43 63 -72 73 72 7 -23 36 54
84 32 97 5 23 -7 62 32 3 7
45 78 28 93 33 33 64 -64 -83 -2
1 5 25 75 34 43 8 7 9 82
5 4 38 9 49 28 -15 32 -69 45
-24 4 8 55 39 72 32 27 8 83
22 27 64 7 44 26 45 66 83 62
52 -7 -36 62 78 -67 34 81 -3 2
27 55 11 -63 3 6 87 -4 -45 4
4 22 72 45 5 -11 2 66
Explanation / Answer
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.