Question: Write a complete C++ program that will do the following: a) Read integers, one per line, from a file called integers.dat. The integers in the

Write a complete C++ program that will do the following: a) Read integers, one per line, from a file called integers.dat. The integers in the file can be positive, negative, or 0. There are at most 125 positive integers (may be less) in the file. Store the positive integers only in an array. b) Output the positive integers to a file called positiveIntegers.dat in reverse sequence (the first integer in the array should be the last one written to the file). c) Write a function that has the array as one of the parameters and returns the average of the positive integers. d) Display on the output screen, with appropriate labels, the number of positive integers and the average of the positive integers.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!