Answered You can hire a professional tutor to get the answer.
a C++ program that reads an unknown number of records from an input file, prog5_301inp. Each record contains a student ID# , the student's semester...
a C++ program that reads an unknown number of records from an input file, prog5_301inp.txt. Each record contains a student ID#, the student's semester average, and the letter grade earned. The program should determine how many students passed, how many failed and how many of each letter grade was assigned. It should then write to an output file prog5_out.txt the input values in tabular form followed by the 'calculated' values. Refer to the sample file output below.
only use functions other than main and those described below. Do not use classes or arrays. (You need practice writing a sentinel value read loop.) Use only the tools presented in lecture. The use of global variables is not allowed.
Input:
To test your program, you will need to create prog5_inp.txt. Each record should contain one string (student ID), one real number (student's semester average), and one character (student's letter grade).
For full credit, you must process as follows
- Call a void function printIdInfo to write the authors' personal information (name, class/section number, lab section number, due date) on the first, second, third and fourth lines of the output file.
- Call a void function printColumnHeaders to write to the output file two blank lines followed by underlined column headers for the table:
ID# Average Grade
- Call a void function getData to read from the input file the student ID#, the semester average, and the semester grade in this order.
- As long as the student ID# is not "A0", process as follows:
a. Call a void function passFailCount to determine how many students passed and how many failed.
i. If the student did not withdraw or take an incomplete,
1. If the semester average is passing,
a. increment a count of students that received a passing grade.
2. otherwise (else)
a. increment a count of students who received a failing grade.
Note: A grade of 59.5 or higher passes the class.
b. Call a void function gradeCount to determine how many of each letter grade was assigned. (A's, B's, C's, D's, F's, W's, & I's)
Note: For full credit, you must use a switch to accomplish this task.
c. Call a void function printStudentData to write to the output file the student ID#, the semester average, and the uppercase semester grade under the appropriate column headers. Hint: To convert lowercase letters to uppercase, use toupper and type casting.
d. Call the void function getData to read the next student ID#, the semester average, and the semester grade.
- Call a void function printPassFailCount to write to the output file two blank lines followed by the number of students who passed the course and the number of students who failed the course...in sentence form.
- Call a void function printGradeCount to write to the output file one blank line followed by the column headers: A B C D F W I under which should be written the number (count) of each letter grade assigned.
- Call the function printIdInfo to write the authors' personal information (name, class/section number, lab section number, due date) to the console.
- Call a void function printOutputFileNotice to write to the console two blank lines followed by a notice to users that the student information has been processed and stored to an output file. Be sure to include the name of the output file in the console notification.
Note: Your logical tests must allow for upper or lower case letter grades on the input file.