using switch and if ... else statements, write the two grading programs. consider the following grading system;

70-100 A
60-69 B
50-59 C
40-49 D
0-39 F

if you're planning to do it with switch it will be a pain

#include <iostream>

using namespace std;

int main ()
{
    int i;
    cout<<"Sigh ";cin>>i;cout<<endl<<"Answer : ";
    if(i>=70 && i<=100)cout<<"A";
    if(i>=60 && i<=69)cout<<"B";
    if(i>=50 && i<=59)cout<<"C";
    if(i>=40 && i<=49)cout<<"D";
    if(i>=0 && i<=39)cout<<"F";
    if(i<0 || i>100)cout<<"Not Good";

}
Comments
Don't hand out code willy-nilly, it's counter productive and against forum rules.

Don't misunderstand, it's okay to post up code for the OP, but don't make it so complete/accurate that they can simply cut/paste it. It is better to post something similar that properly demonstrates a beneficial concept.

Edited 6 Years Ago by Fbody: n/a

Don't misunderstand, it's okay to post up code for the OP, but don't make it so complete/accurate that they can simply cut/paste it. It is better to post something similar that properly demonstrates a beneficial concept.

Okay i will remember that

This article has been dead for over six months. Start a new discussion instead.