I am using PuTTY, the code executes, but the letter grade doesn\'t show. a direc
ID: 3757307 • Letter: I
Question
I am using PuTTY, the code executes, but the letter grade doesn't show.
a directory on the linux server called test1. You must place the test in that directory and lose 5 points and I will organize the file in the appropriate folder. Here is the problem: Write a program (80 pts) AND create a flowchart or psuedocode (15 pts) that will ask the user for 3 grades. The program will calculate the average on those 3 grades. The program wilt display the 3 grades, the average and the letter grade. Output shouid look what is seen below Grade 1:70 Grade 2: 80 Grade 3:90 Average: 80.0 Letter Grade: B The average must display only one decimal place as shown above. You must turn in a flowchart or psuedocode for this test (upload to this assignment page). The .c file should reside on the linux server by the due date in order not to lose any points. After the due date, the flowchart or psuedocode will not be able to be uploaded to the assignment page. 30Explanation / Answer
#include int main() { float average, total; int grade1, grade2, grade3; char grade; while(1) { printf("Enter the 3 grades, (-1 to end): "); scanf("%d", &grade1); if(grade1 == -1) break; scanf("%d", &grade2); scanf("%d", &grade3); average = (grade1 + grade2 + grade3) / 3.0; if(average >= 90) { grade = 'A'; } else if(average >= 80) { grade = 'B'; } else if(average >= 70) { grade = 'C'; } else if(average >= 60) { grade = 'D'; } else { grade = 'F'; } printf("Grade 1: %d ", grade1); printf("Grade 2: %d ", grade2); printf("Grade 3: %d ", grade3); printf("Average: %.1f ", average); printf("Letter Grade: %c ", grade); } }Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.