Question: Program 3: (7 Marks) Write a C++ program that prompts the user to enter the earthquake magnitude and outputs its class. We have six classes
Program 3: (7 Marks) 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, 41, 2. LIGHT if the magnitude is in (4,5L 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 17.8[, 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
Get step-by-step solutions from verified subject matter experts
