Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN C++ Please/ Starting at Problem B. that will contain the file name input by the user, and a file pointer object. Both paramete rs

IN C++ Please/ Starting at Problem B.

image text in transcribed

image text in transcribed

image text in transcribed

that will contain the file name input by the user, and a file pointer object. Both paramete rs should be passed by reference. The parameters will be set to values in the function (when your program obtains the name of the input file from the user and successfully open the file) - and they will be used in the main function of your program. Your program should close each input file after reading all the data in from the file Your program should close the output file after the user decides to exit the program (e.g is, the user responds n as in the example above) . . Assumptions: You can assume each input file will be have at least one salary, and all salaries will be valid numeric values. You can assume No salary will be greater than 10,000,000 dollars, or less than 1 dollar You can assume salaries will have a decimal component. . . . Write, test, and correct your program. Have all the functions, including main, in a single file with the function definitions after main. When you are done, name the source code file 5A.cpp (where you replace with your U of M email address), and submi it using the Homework 5 Problem A link on the class Moodle page. Remember to follow the naming convention diligently Finally, make sure you submit something via Moodle, and do so early. You can always submit a newer version of your program through Moodle before the deadline (delete the old one, submit the new one). For help doing this, see a TA at office hours. Problem B: Computing Statistics from Multiple Statistics (20 points) In problem A of this Homework assignment, the objective is to write a program to compute statistics on data (salaries) stored in in the same format in different files, and store the statistics computed from the data stored in each input file in a single output file containing all the results In this problem, you will write a program to compute statistics on the data stored in the format specified in the results file shown in problem A above. Specifically, your program should read the data in from a file with 1 or more lines of data in the following format string numberl number2 number3 Where string is the name of the file from which the values number1, number2, and number3 were computed. numberl is the minimum average salary extracted from the data in the file number2 is the maximum average salary extracted from the data in the file number3 is the average salary computed from the list of salaries in the file . that will contain the file name input by the user, and a file pointer object. Both paramete rs should be passed by reference. The parameters will be set to values in the function (when your program obtains the name of the input file from the user and successfully open the file) - and they will be used in the main function of your program. Your program should close each input file after reading all the data in from the file Your program should close the output file after the user decides to exit the program (e.g is, the user responds n as in the example above) . . Assumptions: You can assume each input file will be have at least one salary, and all salaries will be valid numeric values. You can assume No salary will be greater than 10,000,000 dollars, or less than 1 dollar You can assume salaries will have a decimal component. . . . Write, test, and correct your program. Have all the functions, including main, in a single file with the function definitions after main. When you are done, name the source code file 5A.cpp (where you replace with your U of M email address), and submi it using the Homework 5 Problem A link on the class Moodle page. Remember to follow the naming convention diligently Finally, make sure you submit something via Moodle, and do so early. You can always submit a newer version of your program through Moodle before the deadline (delete the old one, submit the new one). For help doing this, see a TA at office hours. Problem B: Computing Statistics from Multiple Statistics (20 points) In problem A of this Homework assignment, the objective is to write a program to compute statistics on data (salaries) stored in in the same format in different files, and store the statistics computed from the data stored in each input file in a single output file containing all the results In this problem, you will write a program to compute statistics on the data stored in the format specified in the results file shown in problem A above. Specifically, your program should read the data in from a file with 1 or more lines of data in the following format string numberl number2 number3 Where string is the name of the file from which the values number1, number2, and number3 were computed. numberl is the minimum average salary extracted from the data in the file number2 is the maximum average salary extracted from the data in the file number3 is the average salary computed from the list of salaries in the file

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions

Question

Write a Python program to check an input number is prime or not.

Answered: 1 week ago