0% found this document useful (0 votes)
13 views2 pages

2.1 Selection Control Structure Program-1

This is an activity where we are tasked to make a banking system.

Uploaded by

John Iver Garcia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

2.1 Selection Control Structure Program-1

This is an activity where we are tasked to make a banking system.

Uploaded by

John Iver Garcia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Garcia, John Iverzel D.

BSIT IT11S9

#include <iostream>
using namespace std;

int main() {
double grade;
cout << "Enter your grade: ";
cin >> grade;

if (grade > 100 || grade < 0) {


cout << "INVALID" << endl;
}
else if (grade >= 94 && grade <= 100) {
cout << "1.00" << endl;
}
else if (grade >= 88.50 && grade <= 93.99) {
cout << "1.25" << endl;
}
else if (grade >= 83 && grade <= 88.49) {
cout << "1.50" << endl;
}
else if (grade >= 77.5 && grade <= 82.99) {
cout << "1.75" << endl;
}
else if (grade >= 72 && grade <= 77.49) {
cout << "2.00" << endl;
}
else if (grade >= 65.5 && grade <= 71.99) {
cout << "2.25" << endl;
}
else if (grade >= 61 && grade <= 65.49) {
cout << "2.50" << endl;
}
else if (grade >= 55.5 && grade <= 60.99) {
cout << "2.75" << endl;
}
else if (grade >= 50 && grade <= 55.49) {
cout << "3.00" << endl;
}
else if (grade >= 1 && grade <= 49) {
cout << "FAILED" << endl;
}
else {
cout << "INVALID" << endl;
}

return 0;
}
Documentation:

I have designed this to convert numeric grades into their corresponding result following a standard
grading scale. This program prompts the user for a grade, first checks whether this falls within the 0-100
range and then determines the result by using several if-else statements. This code provides a direct,
efficient solution to educators or students who need to evaluate quickly and make sense of numerical
grades. Presently, it works fine for my purpose; however, I am open to suggestions on how it might be
improved-for example, using robust error handling, improving formatting, and perhaps optimizing the
grade comparison process for larger datasets.

You might also like