Commit 4a6de7f5 authored by Michael's avatar Michael

michael.davityan:exercise_06_33v4

parent f50e2ea2
Pipeline #25349159 passed with stage
in 1 minute 5 seconds
......@@ -12,7 +12,7 @@ main()
}
int averageGrade;
std::cin >> averageGrade;
if ((averageGrade <= 0) || (averageGrade > 100)) {
if ((averageGrade < 0) || (averageGrade > 100)) {
std::cerr << "Error 1: must be more than 0 or less than 100.\n";
return 1;
}
......@@ -24,11 +24,13 @@ main()
int
qualityPoints(const int averageGrade)
{
assert((averageGrade > 0) && (averageGrade <= 100));
assert((averageGrade >= 0) && (averageGrade <= 100));
if (100 == averageGrade) {
return 4;
}
int variableForAverageGrade = averageGrade / 10 % 10;
switch (variableForAverageGrade)
{
case 0 : return 4;
case 9 : return 4;
case 8 : return 3;
case 7 : return 2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment