It needs toaccept between 2 and 30 students and attendance for each of up to10 d
ID: 3619056 • Letter: I
Question
It needs toaccept between 2 and 30 students and attendance for each of up to10 days.
The attendancecan be Present(P), Absent(A), or Excused(X).
It needs to savethis information to disk, since each item above could be entered ata different time.
It needs toprint (upon request), the results for each student. These resultsshould include a percentage present (days present / (total days sofar – days excused).
BasicProcess:
Program should check for disk file.If it does not find it, it should go into “ask for studentname” mode and get class list.
Otherwise it should accept inputfrom operator indicating what type of data is being handled (e.g. Sfor adding student, A for entering attendance, etc.) or that areport is wanted (e.g. R).
When asking for attendance input,the program should ask for what date (e.g. 1, 2, …), theprogram should display the name of the student and accept theattendance code.
It should be possible to addstudents and it should be possible to change attendanceentries.
Program shouldnot use global variables and should have multiple functions.
The student datashould be placed in an array of structures.
Report formshould be something like:
Name 1 23 4 5 6 7 8 9 10 %
JohnSmith P P A 67
Bob Doe PP P 100
Tom Thu AA A 0
Explanation / Answer
please rate - thanks to get you started--you never responded to my message #include #include #include using namespace std; struct student { string last; string first; char att[10]; } ; char menu(); void printmenu(); void report(student[],int); void add(student[],int&); void enter(student[],int); int main () {fstream file; int i,j,n=0; char choice; student stu[30]; for(i=0;istu[n].last; while(file) {file>>stu[n].first; for(i=0;i>stu[n].att[i]; n++; file>>stu[n].last; } file.close(); file.clear(); } do { choice=menu(); switch(choice) {case 'S': add(stu,n); break; case 'A': enter(stu,n); break; case 'R': report(stu,n); case 'X': break; } }while(choice!='X'); file.open("attendance.txt",ios::out); for(j=0;jRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.