Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are to write a program that will manipulate an array. Your program should handle up to 100 integer numbers. Label the results for each

You are to write a program that will manipulate an array. Your program should handle up to 100 integer numbers. Label the results for each printed out below. You will have several different outputs below. Print your results in the same order given below. For each part below, write one or more functions (there are a number of functions). Restriction: A function that does any of the calculations listed below can NOT print out the results in that function but you must print out results in either the main routine or call a different function that only prints a result. A function does one task and only one task. ------------------------------------ 1. 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 of the calculation below. The input is found in arrayV3.dat 2. Print out all the values in the array with no more than 10 numbers per output line. 3. Print out the average of the set of numbers. 4. Print out the range of the values in the array. (two values printed.) 5. Print out how many values are larger than the average and how many are smaller than the average. Pass average as a parameter. 6. Convert every negative number to a positive number. Print out the array. 7. Print out the average of the set of numbers. 8. How many numbers in the array are multiples of 9 and 17? 9. How many values in the array are greater than the 12th element in the array? 10. List the range of values in the array. 11. Find the smallest number and print out the number and its position. 12. Zero out all even value numbers in the array and print out the array. 13. Print out the new average for the new array, ignoring the zeros. 14. Print out the range of values in the array. 15. Create a second array. Copy all the data elements from the first array to the second array. Print out the second array. You will pass two arrays to this function. 16. Now copy all the data elements from the first array to the second array in reverse order. Print out the second array. You will pass two arrays to the reverse function. This is in C++ and I forgot to add the text file in my previous question. I'll do that this time. 24 43 63 -72 73 72 77 23 36 94 22 58 -55 -34 -41 28 93 9 92 -8 83 -36 73 5 38 56 95 96 11 3 6 -5 17 93 80 99 26 19 62 72 8 4 48 21 54 84 32 97 74 94 82 57 4 38 27 83 83 22 27 64 7 44 26 45 66 83 62 52 -7 -36 62 78 -67 34 73 93 8 -3 -2 2 27 1 11 12 -73 83 77 54 37 72 82 23 0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Performance Indexing In SQL Server

Authors: Jason Strate, Grant Fritchey

2nd Edition

1484211189, 9781484211182

More Books

Students also viewed these Databases questions

Question

How was their resistance overcome?

Answered: 1 week ago

Question

3. What strategies might you use?

Answered: 1 week ago