Oct 2, 2012 at 1:02am UTC
I have been asked to write a simple program to determine the grade of a student given the condition below;
0 - 49 =F
50 - 59 =D
60 - 69 =C
70 - 79 =B
80 - 100 =A
Please i need help on how to initiate, where and when to loop. The way the tutor teaches us makes it difficult to understand the c++ language. Please help me out.
Oct 2, 2012 at 1:26am UTC
Something like this I believe.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
#include <iostream>
using namespace std;
int main()
{
int percent;
cout << "Enter percentage" << endl;
cin >> percent;
cout << "\n" ;
if ((percent > 0) && (percent <= 49))
{
cout << "This student got an F" << endl;
}
if ((percent > 49) && (percent <= 59))
{
cout << "This student got a D" << endl;
}
if ((percent > 59) && (percent <= 69))
{
cout << "This student got a C" << endl;
}
if ((percent > 69) && (percent <= 79))
{
cout << "This student got a B" << endl;
}
if ((percent > 79) && (percent <= 100))
{
cout << "This student got an A" << endl;
}
else {cout << "Not a valid number" << endl;}
}
Last edited on Oct 2, 2012 at 1:38am UTC
Oct 2, 2012 at 1:36am UTC
I wish my school used that grading scale.
Oct 16, 2012 at 10:43am UTC
How do i write a program to calculate the area of the following shapes; circle, rectangle, square, triangle and trapezium using a switch case? Switch case concept is new to me. Please help me out.
Last edited on Oct 16, 2012 at 10:44am UTC
Oct 16, 2012 at 11:36am UTC
Im not good at math or geometry so sorry i cant help, unless you give alot more info and maybe i could.