Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using the switch statement, write a program that converts a numerical grade into

ID: 441070 • Letter: U

Question

Using the switch statement, write a program that converts a numerical grade into a letter grade: (grading scale is A=90-100, B= 80-89, C=70-79, D= 60-69, F=0-59) //output should look like this Enter numerical grade: 84 Letter Grade: B This is my program so far. I tried two different programs and neither worked. I just need help to make mine work because i cant use anyother advanced programming techniques because this is a beginning class. //----------Chapter 5------------Project 10------------ //--------------GRADING SCALE PROJECT------------------ #includeint main(void) { int grade1, grade2; printf("Enter a numerical grade: "); scanf("%d%d", &grade1, &grade2); printf("Letter Grade: %d ", grade1); switch (grade1) { case 0: case 1: case 2: case 3: case 4: case 5: printf("F"); break; case 6: printf("D"); break; case 7: printf("C"); break; case 8: printf("B"); break; case 9: case 100: printf("A"); break; default: printf("Illegal Grade"); break; } return 0; } second try: //----------Chapter 5------------Project 10------------ //--------------GRADING SCALE PROJECT------------------ #includeint main(void) { int grade1; printf("Letter Grade: %d ", grade1); switch (grade1) { case (>=59): printf("F"); break; case (>=60): printf("D"); break; case (<=69): printf("D"); break; case (>=70): printf("C"); break; case (<=79): printf("C"); break; case (>=80): printf("B"); break; case (<=89): printf("B"); break; case (>=90): printf("A"); break; case (<=100): printf("A"); break; }

Explanation / Answer

You need this: #include using namespace std; int main() { //variable declaration int marks_obtained; cout marks_obtained; switch(marks_obtained/10) { case 10: // break is not given case 9 : cout