Last active
August 29, 2015 13:56
-
-
Save bitwiser/9197433 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
void getScore(int &a){ | |
cout<<"Enter score(0-100): "; | |
cin>>a; | |
cout<<"You entered: "<<a<<endl; | |
} | |
void printGrade(int a){ | |
if(a>=0 && a<=59){ | |
cout<<"Grade F\n"; | |
}else if(a>=60 && a<=69){ | |
cout<<"Grade D\n"; | |
}else if(a>=70 && a<=79){ | |
cout<<"Grade C\n"; | |
}else if(a>=80 && a<=89){ | |
cout<<"Grade B\n"; | |
}else if(a>=90 && a<=100){ | |
cout<<"Grade A\n"; | |
} | |
} | |
int main(){ | |
int score; | |
getScore(score); | |
printGrade(score); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment