Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(10pts) Suppose score is a double variable that stores a student's score in a class. It has been declared and initialized. ) Suppose maxscore is

image text in transcribed
(10pts) Suppose score is a double variable that stores a student's score in a class. It has been declared and initialized. ) Suppose maxscore is another double variable that has been declared and assigned by the highest score among all students in a class. Suppose grade is a char variable that has been declared. Write a nested-if-else statement to assign an appropriate letter grade to the grade variable according to the following rules: 1. If score is within 10 points of maxScore, it is a A grade. 2. Otherwise, if score is within 20 points of maxScore, it is a B grade. 3. Otherwise, if score is within 30 points of maxScore, it is a C grade. 4. Otherwise, if score is within 40 points of maxScore, it is a D grade. 5. Otherwise, it is an F 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

Recommended Textbook for

More Books

Students also viewed these Databases questions