Question: #include #include #include #include using namespace std; / / function to print the last name of the student void printLastName ( string name ) {
#include
#include
#include
#include
using namespace std;
function to print the last name of the student
void printLastNamestring name
cout name.substrnamefindlastof;
function to compute and print the grade percentage and letter grade
void computeGradeint score, int total
double percentage doublescore total ;
double roundedPercentage ceilpercentage ;
cout roundedPercentage ;
if percentage
cout "Excellent" endl;
else if percentage
cout "Well Done" endl;
else if percentage
cout "Good" endl;
else if percentage
cout "Need Improvement" endl;
else
cout "Fail" endl;
int main
open input file
ifstream myfile studentstxt;
if input.isopen
cerr "Failed to open file." endl;
return ;
read data for each student
string name;
int score, total;
for int i ; i ; i
input name score total;
compute and print the grade for the student
printLastNamename;
computeGradescore total;
close input file
input.close;
return ;
I cannot get this program to import the file. What am I doing wrong I have the file saved as students in that same folder.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
