#include<iostream> #include <string> #include <fstream> #include <iomanip> using
ID: 3611117 • Letter: #
Question
#include<iostream>
#include <string>
#include <fstream>
#include <iomanip>
using namespace std;
int main()
{
ifstream infile; //Input filestream variable
ofstream outfile; //Output filestream variable
string StudentData; //Student data file
string GradeData; //Grade data file
sting OutputFile; //Output file
cout<<"Pleaseenter name of student data file"<<endl;
cin>>StudentData;
infile.open(StudentData.c_str());
cout<<"Please enter name of grade datafile"<<endl;
cin>>GradeData;
infile.open(GradeData.c_str());
cout<<"Please enter the name of the output file "
<<"to becreated"<<endl;
outfile.open(OutputFile.c_str());
Explanation / Answer
please rate - thanks round 1 complete #include #include #include #include using namespace std; #define MAX 30 struct grades { int id; char last[12]; char first[12]; int exam[3]; int hw[10]; } stu[MAX]; void getinfo(grades[],ifstream &,int&); void sort(grades[],int); void report(grades[],int,ofstream &); void switchit(char[]); int valid(grades[],int,int); void readtillQ(grades[],ifstream &,int,int); int main() { ifstream infile; //Input filestream variable ifstream infile2; //Input filestream variable ofstream outfile; //Output filestream variable string StudentData; //Student data file string GradeData; //Grade data file string OutputFile; //Output file int count=0,rec,newid; cout>num>>score; if(type=='E') stu[rec].exam[num-1]=score; else if(type=='H') stu[rec].hw[num-1]=score; } } void getinfo(grades stu[],ifstream & infile,int& count) {infile>>stu[count].id; while(infile) {infile>>stu[count].last>>stu[count].first; switchit(stu[count].last); switchit(stu[count].first); count++; infile>>stu[count].id; } return; } void sort(grades stu[],int count) {int i,j; grades temp; for(i=0;iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.