Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need the whole program wrote in C++ Algorithm 1-5 Fall 2017 CPE211 Project Assignment Project 6 You will write a program that performs the

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed I need the whole program wrote in C++ Algorithm 1-5

Fall 2017 CPE211 Project Assignment Project 6 You will write a program that performs the following tasks (read and understand number 6 and 7): (1) Command line arguments are to be used to open the input file and the output file. The first attempt for the open is using the file names provided as command line arguments. The first argument is the input file and the second is the output file. The program is to test for the correct number of arguments. If an incorrect number of arguments is used, output a message and terminate the program run the sample solution to see what the message is (2) Open a user-specified file for input. If the input file name provided as a command line argument fails to open successfully, enter into a loop that prints out an error message, resets the input file stream variable (see the hints section #1), obtains a new file name, echo prints the filename and tries to open the new file. The loop continues until the user successfully enters a valid file name or presses ctrl-c to exit. The first file name tried will come from the command line (hints #12) (3) Open a user-specified file for output. If the output file name provided as a command line argument fails to open successfully, enter into a loop that prints out an error message, resets the output file stream variable (see the hints section #1), obtains a new file name, echo prints the filename and tries to open the new file. The loop continues until the user successfully enters a valid file name or presses ctrl-c to exit. The first file name tried will come from the command line (hints #12) (4) If the input file is empty, your program shall write a message to the terminal AND the output file indicating that the input file was empty. Note if the input file is empty, an empty input file message only is written to the output file (no header information). (see the hints section #2) (5) All other output is to be written to the output file (6) The input file contains integer assignment scores for several students (one student and scores per line). For each student in the file, the program reads a student's last name, first name, their quiz grades, their homework grades and their exam scores. Score values are in the range 0 to 100 inclusive. Look at all of the provided input files to see what the information looks like (7) The first line in the input file contains 3 integer values separated by spaces: The number of quiz scores, the number of homework grades and the number of exam scores. These values are used with count controlled loops that read in the score information for each student. (8) The second line in the input file is the key line (The first and last names for the key line are "Key") which provides the maximum score for each assignment. Non empty files will have a key line and information for zero or more students. Empty files will contain no information (9) Column header information and the key values are written to the output file as shown by running the sample solution. All column values are placed in a specific field width as specified in hints section #10 (10) As shown in the sample solution, print a summary of each student's information: The number associated with the student (from their order in the input file) a. b. Up to 10 characters (use substring function) of the last name c. Up to 5 characters (use substring function) of the first name d The total of the quiz scores, The total of the homework scores, e. f. The total of the exam scores, and g. The students average (sum of their scores divided by the sum of the key values) Print out the average as a percent with a precision of 2 decimal places (i.e. 67.87) (11) If one or more students are in the class, compute and output the class average after the information for all students has been read and output, Compute and output the class average. If no student information is in the file output a message to the output file and the terminal (as shown in the sample solution) Page 2 of 4 Fall 2017 CPE211 Project Assignment Project 6 You will write a program that performs the following tasks (read and understand number 6 and 7): (1) Command line arguments are to be used to open the input file and the output file. The first attempt for the open is using the file names provided as command line arguments. The first argument is the input file and the second is the output file. The program is to test for the correct number of arguments. If an incorrect number of arguments is used, output a message and terminate the program run the sample solution to see what the message is (2) Open a user-specified file for input. If the input file name provided as a command line argument fails to open successfully, enter into a loop that prints out an error message, resets the input file stream variable (see the hints section #1), obtains a new file name, echo prints the filename and tries to open the new file. The loop continues until the user successfully enters a valid file name or presses ctrl-c to exit. The first file name tried will come from the command line (hints #12) (3) Open a user-specified file for output. If the output file name provided as a command line argument fails to open successfully, enter into a loop that prints out an error message, resets the output file stream variable (see the hints section #1), obtains a new file name, echo prints the filename and tries to open the new file. The loop continues until the user successfully enters a valid file name or presses ctrl-c to exit. The first file name tried will come from the command line (hints #12) (4) If the input file is empty, your program shall write a message to the terminal AND the output file indicating that the input file was empty. Note if the input file is empty, an empty input file message only is written to the output file (no header information). (see the hints section #2) (5) All other output is to be written to the output file (6) The input file contains integer assignment scores for several students (one student and scores per line). For each student in the file, the program reads a student's last name, first name, their quiz grades, their homework grades and their exam scores. Score values are in the range 0 to 100 inclusive. Look at all of the provided input files to see what the information looks like (7) The first line in the input file contains 3 integer values separated by spaces: The number of quiz scores, the number of homework grades and the number of exam scores. These values are used with count controlled loops that read in the score information for each student. (8) The second line in the input file is the key line (The first and last names for the key line are "Key") which provides the maximum score for each assignment. Non empty files will have a key line and information for zero or more students. Empty files will contain no information (9) Column header information and the key values are written to the output file as shown by running the sample solution. All column values are placed in a specific field width as specified in hints section #10 (10) As shown in the sample solution, print a summary of each student's information: The number associated with the student (from their order in the input file) a. b. Up to 10 characters (use substring function) of the last name c. Up to 5 characters (use substring function) of the first name d The total of the quiz scores, The total of the homework scores, e. f. The total of the exam scores, and g. The students average (sum of their scores divided by the sum of the key values) Print out the average as a percent with a precision of 2 decimal places (i.e. 67.87) (11) If one or more students are in the class, compute and output the class average after the information for all students has been read and output, Compute and output the class average. If no student information is in the file output a message to the output file and the terminal (as shown in the sample solution) Page 2 of 4

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

More Books

Students also viewed these Databases questions