Hey guys total newbie here this grading software excercise is giving me trouble.
I cant get the second else if to give me the output B. Here are the instructions.
//Grading Program: Write a program that allows the user to enter the grade scored in a programming class (0-100).
//If the user scored a 100 then notify the user that they got a perfect score.
//Modify the program so that if the user scored a 90 - 100 it informs the user that they scored an A
//Modify the program so that it will notify the user of their letter grade
//0 - 59 F 60 - 69 D 70 - 79 C 80 - 89 B 90 - 100 A
float grade;
int main() {
cout << "This is a grading software" << endl;
cout << "Please Enter Your Grade" << endl;
PLEASE ALWAYS USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/ http://www.cplusplus.com/articles/z13hAqkS/
Hint: You can edit your post, highlight your code and press the <> formatting button.
You can use the preview button at the bottom to see how it looks.
Tested your code and it worked fine. I did make two changed: 1. changed "float grade" to "double grade" because floats do not always store the decimal portion correctly. 2. Moved "double grade" inside main because it does not need to be a global variable and global variables are should not be used for most programs.
If you are still having problems maybe some more detail about what is going wrong.