Writeacprogramthatwill


Program

Write a C++ program that will:

Ask the user for the name of an input file. Read in this name and open that text file for input.

Ask the user which of two options they want to do:

Read in student data
Count lines and characters

Read in the user's response, and perform the specified operation.

Specifically, if the user chooses the student data option,

For each student record,

read in the student name (a string),
read in the number of scores for that student (an int)
read in all of the scores for that student, adding them into

a total as they are found (doubles).

Calculate the average score for that student (double).
Write out the student name, the number of scores, and the

average score for that student.

Repeat until no more student records are found.

If the user chooses the lines and characters option,

Read in each line of the file
If a line contains some text (is non-empty), then count that line and

find the number of characters that the line contains.

Continue until no more lines of text are found in the file.
Write out the total number of lines that contained text and the

Average number of characters that were found per line.

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Writeacprogramthatwill
Reference No:- TGS01597926

Now Priced at $30 (50% Discount)

Recommended (94%)

Rated (4.6/5)