Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

rewrite the c++ program processes into functions by performing the following: 2. Create int function(s) for opening the input and output files. These opens may

 rewrite the c++ program processes into functions by performing the following: 2. Create int function(s) for opening the input and output files. These opens may be in the same function. This function MUST RETURN an int value to indicate the success or failure of the open(s). Test this value and take appropriate action after the function call. This function MUST have the following parameters, in any order: a. input file stream b. output file stream 3. Create a void function to read the data file. This function MUST have the following parameters, in any order: a. input file stream b. OUT parameter to return the total of all values c. OUT parameter to return the number of values read 4. Create a value returning function (I'm leaving it up to YOU to choose the correct type) to return the avg of the numbers read. This function MUST have the following parameters, in any order: a. IN parameter to pass in the total of the numbers read b. IN parameter to pass in the number of values read 5. Create void function(s) for closing the input and output files. These closes may be in the same function. This function MUST have the following parameters, in any order. a. input file stream b. output file stream 6. Move the global variables (defined before main in reWriteThis.cpp) and place them within the appropriate functions. Some will be needed with the related function, some will still be needed in main. 7. FOR PRACTICE, do NOT use the same variable names as ARGUMENTS in the function call and PARAMETERS in the function heading definition. 8. You MUST use function prototypes (before main) and you MUST define your functions AFTER main. 9. The console (cout) and file writes remain in main. 10. Either create a file named inFile.txt that contains: a. The number of values to add b. A number of integer values matching the number read in a. OR c. Download and use attached inFile.txt **inFile.txt ( 12 1 6 8 90 34 23 45 23 12 59 33 24)

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

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

More Books

Students also viewed these Databases questions

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago