Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part 1 Make a program that will ask the user for a grade (A, B, C, D or F) and display one of the messages

image text in transcribed
Part 1 Make a program that will ask the user for a grade (A, B, C, D or F) and display one of the messages depending on the grade. If the grade is an A or B, display "Good job". If the grade is a C, display "OK" If the grade is a D or F, display "Work harder". For any other letter (the user entered a letter other than an A, B, C, D or F), display "Invalid grade". Use the following structure if the grade is A or B display "Good job" else if the grade is C display "OK" else display "Invalid" HINT if(grade = A || B) The above if has 3 problems! 1. How do you check equality? = is an assignment operator 2. A and B are considered variables by the compiler. 3. B is not compared to anything. Test your program using the following grades. B Grade Message Good job Good job C Work Harder Work Harder Invalid grade

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions