Gradebook Automation Problem: Design, develop, implement, and test a computing s
ID: 3609972 • Letter: G
Question
Gradebook Automation
Problem:
Design, develop, implement, and test a computing system thatautomates an instructor’s gradebook. The userwill interact with the system through a simple command basedinterface. The system will first display a menu forthe user. The commands that the system can process are detailedbelow.
The grading scale used for the students is as follows:
90 -100
A
80 - 89
B
70 - 79
C
60 - 69
D
below 60
F
The program will process as many students as the file holds upto a predetermined maximum number (for example 10), The system willcompute the average for each student, error check the grades forvalidity
(A grade is considered invalid if it is negative), and write outthe data to a text file.
This system must retain the student information on disk, whichshould be read in at the beginning of program execution.
Also, develop a command-base interface for you program. Theinstructor (the user) will interact with the system through asimple command-based user interface. The commands are input fromthe user as single letters corresponding to the following:
S: Setup a new semester - The system will readfrom disk the number of programming assignments (range 0 - 10), thenumber of quizzes (range 0 - 10), and if a midterm is given or not(range 0 - 1). It will also read from disk the relative weights ofthe assignments, quizzes, midterm, and final. These relativeweights are expressed as percentages of the semester grade and mustadd up to 100%. Finally, all the student grade data will be readin. After reading the data it sums the programming assignmentsgrades and the quiz grades for each student and stores the averageof assignments and average of quizzes in the students grade array.Then it calculates the weighted average (stored in student gradearray) and convert it to a letter grade.
O: Output grade data to a text file - Thestudent number, and grade book data must be printed out to a fileGRADEOUT. Format the data nicely, with appropriate labels.
E: Exit system - Save all the student recorddata to the GRADEDAT file, and terminate the program.
Note: The S (Setup) commandmust be made (once per semester) before the O(Output) command can be given).
This program must be written using modular design. Strictmodular communication must be used. Shared memory locations mayonly be used for program constants.
Follow design and implementation strategies discussed on myweb-page under RULES. The format required for each programmingassignment can be viewed on my web-page under the course CIS113Case Studies.
90 -100
A
80 - 89
B
70 - 79
C
60 - 69
D
below 60
F
Explanation / Answer
Dear, #include <iostream>#include <iomanip>
#include <fstream>
#include <string>
using namespace std;
void calculateAverage(ifstream& inp, double& classAvg);
void calculateGrade(float average);
int main() {
string last_name;
//int numberofscores;
double score1=0, score2=0, score3=0,score4=0, score5=0;
ifstream inData;
ofstream outData;
inData.open("\scores.txt");
outData.open("\scorecomplete.out");
inData >> last_name >> score1>> score2 >> score3 >> score4 >>score5;
outData << "Student " <<setw(3) << "Test1" << setw(3) << "Test2" <<setw(3) << "Test3" << setw(3)<< "Test4" <<setw(3) << "Test5" << setw(3) << "Average"<< setw(3) << "Grade" << endl;outData <<last_name << setw(3) << score1 << setw(3)<< score2 << setw(3) << score3 <<setw(3) << score4 << setw(3) << score5<< setw(3) << endl; cout << "The values of the input from the file are:";
cout << last_name << " " << score1 << " "<< score2 << " " << score3 << " " <<score4 << " "<< score5 << endl;
inData.close();
outData.close();
system("pause");
return 0;
}
void calculateAverage() {
do {
average = (score1* score2 * score3 * score4 * score5)/5; } while(average != -1);
}
void calculateGrade(float average) {
char grade;
if(average >=90)
{
grade = 'A';
}
else if (average >=80)
{
grade = 'B';
}
else if (average >=70)
{
grade = 'C';
}
else if (average >=60)
{
grade = 'D';
}
else if (average <= 59)
{
grade = 'F';
}
}
I hope this is helpful foryou...... Dear, #include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
using namespace std;
void calculateAverage(ifstream& inp, double& classAvg);
void calculateGrade(float average);
int main() {
string last_name;
//int numberofscores;
double score1=0, score2=0, score3=0,score4=0, score5=0;
ifstream inData;
ofstream outData;
inData.open("\scores.txt");
outData.open("\scorecomplete.out");
inData >> last_name >> score1>> score2 >> score3 >> score4 >>score5;
outData << "Student " <<setw(3) << "Test1" << setw(3) << "Test2" <<setw(3) << "Test3" << setw(3)<< "Test4" <<setw(3) << "Test5" << setw(3) << "Average"<< setw(3) << "Grade" << endl;outData <<last_name << setw(3) << score1 << setw(3)<< score2 << setw(3) << score3 <<setw(3) << score4 << setw(3) << score5<< setw(3) << endl; cout << "The values of the input from the file are:";
cout << last_name << " " << score1 << " "<< score2 << " " << score3 << " " <<score4 << " "<< score5 << endl;
inData.close();
outData.close();
system("pause");
return 0;
}
void calculateAverage() {
do {
average = (score1* score2 * score3 * score4 * score5)/5; } while(average != -1);
}
void calculateGrade(float average) {
char grade;
if(average >=90)
{
grade = 'A';
}
else if (average >=80)
{
grade = 'B';
}
else if (average >=70)
{
grade = 'C';
}
else if (average >=60)
{
grade = 'D';
}
else if (average <= 59)
{
grade = 'F';
}
}
I hope this is helpful foryou......
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.