/*File: switchgrade.c This program reads a grade from the screen and prints the corresponding numerical value of the score.*/ #include int main() { char grade; double score; printf("Enter a grade [A,B,C,D,F]: "); scanf(" %c",&grade); //Force all characters to be uppercase if(grade>=97) { grade = grade-32; } switch(grade) { case 'A': score += 1.0; case 'B': score += 1.0; case 'C': score += 1.0; case 'D': score += 1.0; case 'F': break; default: score = -1; printf("Invalid grade %c\n",grade); break; } if(score != -1) { printf("The score for the grade %c is %.2f\n",grade,score); } return 0; }