Write a program to read in a series of characters representing student's grades from a file called "grades.txt" until the first blank space is reached. Echo and print the input data, one character per line. If the grade is A, B, C, or D, it is a passing grade. If it is F, it is a failing grade. Any other character will produce an error message.
The program must count how many passing grades, how many failing grades and how many errors were found. At the end of the program, print all the counts. YOU MUST USE function(s) to solve the program, such as a function to get and print the input data, and a function to check whether the grade is pass of fail or error.
For example: if the file contained AFBDFXC XABCYZ
the program should report:
there were 4 passes, 2 failure and 1 error.
Remember, it must stop at the blank! You need to use the get function to read the blank.
#include<iostream>
#include<fstream>
using namespace std;
int main()
{
isftream infile;
infile.open("grades.txt");
<Your calling fundtions code goes here>
return 0;
I feel almost obligated to say something. Do you have any idea how many people come on this site asking people to do their homework for them?
If you don't have time then that's probably your own fault. If it's not your fault and due to unforeseen circumstances, then your teachers would have likely granted an extension.