Code:
#include <iostream>
int main()
{
int grade;
std::cout << "Enter your grade %: ";
std::cin >> grade;
if (grade <= 60) {
std::cout << "You scored an F\n"; }
if (grade > 60 && grade <= 70) {
std::cout << "You scored a D\n"; }
if (grade > 70 && grade <= 80) {
std::cout << "You scored a C\n"; }
if (grade > 80 && grade <= 90) {
std::cout << "You scored a B\n"; }
if (grade > 90 && grade <= 100) {
std::cout << "You scored an A!\n"; }
}
Modify the previous program to print out a + or - after the letter grade based on the last digit of the score.
1-3: -
4-7: blank
9-0: +
for instance:
I mean like say it's the grade is 33, it'd be an F-
say the grade is 35, it'd be an F
say the grade is 39, it'd be an F+
say the grade is 73, it'd be an C-
say the grade is 75, it'd be a C
say the grade is 70, it'd be a C+
do i need to use a character array to do this? with strcat? or? and is there another way of doing it or?