0

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

4
Contributors
6
Replies
7
Views
6 Years
Discussion Span
Last Post by Robert1995
Featured Replies
  • 1

    [QUOTE=roin14;1174729]write the two grading programs. [/QUOTE] You would probably learn more if you [URL="http://www.daniweb.com/forums/announcement8-2.html"]wrote them yourself[/URL] :icon_wink: Read More

-1

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.
0

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 by Fbody: n/a

0

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 topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.