Skip to content

Instantly share code, notes, and snippets.

@mlcollard

mlcollard/Midterm.cpp Secret

Last active Feb 19, 2021
Embed
What would you like to do?
int main() {
// Midterm Exam I
Test midterm1("Midterm I",
"2021-02-25 12:15:00 -04:00",
"2021-02-25 13:30:00 -04:00");
// Give the test
if (!midterm1.giveTest()) {
std::cerr << "error: Unable to give test " << midterm1.getName()
<< " from " << midterm1.getStartTime()
<< " to " << midterm1.getStopTime() << '\n';
return 1;
}
// Collect the test
midterm1.collectTest();
// Score the test
midterm1.checkAnswers();
midterm1.scoreTest();
// Enter the test into the gradebook
int score = midterm1.getScore();
if (!midterm1.enterGrade()) {
std::cerr << "error: Unable to enter test score for " << midterm1.getName()
<< " into the gradebook\n";
return 1;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment