Im new to C++ and im working on a school assignment but i have no clue what to do next... The next steps in this assignment are:
*If the user enters a value greater than 100, ask the user if they are sure about the grade.
*If they answer y or Y allow the grade. Display any grades greater than 100 as an A+
*If the grade entered is within 0.5 of the next letter grade, ask the user if they want to round the letter grade up.
*If they answer y or Y add 0.5 to the grade before deterring letter grade.
Ive done most of the assignment but dont have a clue how to display the A+...and not sure if i continue doing the samething with IF statements for the 0.5 that will be rounded up...
If someone could give me some pointers I would greatly appreciate it. Thank you
#include <iostream>
using namespace std;
int main()
{
float grade;
char letter;
char yesno;
cout << "Please enter a grade between 0 and 100: ";
cin >> grade;
cout << "Is the grade eligible for extra credit: ";
cin >> yesno;
If that code was any longer I'd ask for code tags.
You're going to basically need a ton of nested if statements. Within each grade, you need to check to see if it's 0.5 points within the next grade and ask. There's really no other solution I can conceive.
You cannot display an A+ with a char. That simple. If you plan on doing so you need to switch to icky char[] or std::string.