Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable naming convention #123

Merged
merged 1 commit into from
Mar 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ int main(int argc, char *argv[]) {
}

// Create new GPA calculator.
std::shared_ptr<PersonalGPA> chumeochuixoong =
std::shared_ptr<PersonalGPA> personalGPAObj =
PersonalFactory ::instance()->create(mode, input);

/**
Expand All @@ -70,22 +70,22 @@ int main(int argc, char *argv[]) {

// Print the stats.
std::cout << "Total passed courses: "
<< chumeochuixoong->getTotalCoursesPassed() << " ("
<< Utility::percent(chumeochuixoong->getTotalCoursesPassed(),
chumeochuixoong->getTotalCourses())
<< personalGPAObj->getTotalCoursesPassed() << " ("
<< Utility::percent(personalGPAObj->getTotalCoursesPassed(),
personalGPAObj->getTotalCourses())
<< "%)" << '\n';

// Print passed table
OutputHelper::instance()->printTable(chumeochuixoong->toPassedVector());
OutputHelper::instance()->printTable(personalGPAObj->toPassedVector());

// Print credit stats
if (chumeochuixoong->getTotalCoursesPassed() > 0) {
if (personalGPAObj->getTotalCoursesPassed() > 0) {
std::cout << "Passed credit details: " << '\n';
for (const auto &credit : chumeochuixoong->getCreditDetail()) {
for (const auto &credit : personalGPAObj->getCreditDetail()) {
std::cout << "Courses type " << credit.first << ": " << credit.second
<< " ("
<< Utility::percent(credit.second,
chumeochuixoong->passedCredits())
personalGPAObj->passedCredits())
<< "%)" << '\n';
}
}
Expand All @@ -94,13 +94,13 @@ int main(int argc, char *argv[]) {

// Print failed stats.
std::cout << "Total failed courses: "
<< chumeochuixoong->getTotalCoursesFailed() << " ("
<< Utility::percent(chumeochuixoong->getTotalCoursesFailed(),
chumeochuixoong->getTotalCourses())
<< personalGPAObj->getTotalCoursesFailed() << " ("
<< Utility::percent(personalGPAObj->getTotalCoursesFailed(),
personalGPAObj->getTotalCourses())
<< "%)" << '\n';

// Print failed table.
OutputHelper::instance()->printTable(chumeochuixoong->toFailedVector());
OutputHelper::instance()->printTable(personalGPAObj->toFailedVector());
}

// And catch exceptions
Expand Down
Loading