Question: Write a C++ program that prompts the user to enter the earthquake magnitude and outputs its class We have six classes as follows: 1. MINOR

 Write a C++ program that prompts the user to enter the

Write a C++ program that prompts the user to enter the earthquake magnitude and outputs its class We have six classes as follows: 1. MINOR if the magnitude is in [0,4 2. LIGHT if the magnitude is in (4.51 3. MODERATE if the magnitude is in [5, 6[. 4. STRONG if the magnitude is in (6.7[. 5. MAJOR if the magnitude is in [7, 81, 6. GREAT if the magnitude is in [8, col For instance, if the user enters a magnitude of 5.5, the program should output "MODERATE". If the user enters a magnitude of 6, the program should output STRONG If the user enters a negative value, the program should output the following text: "This is not a valid magnitude value Hint use nested if-else statement

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!