Question: This question Is about Block 1 Section 4.4 (Analyoe multiple canos). The magnitude of oarthquakos is ofton moasured using the numeric Richter scale, which can

 This question Is about Block 1 Section 4.4 (Analyoe multiple canos).

This question Is about Block 1 Section 4.4 (Analyoe multiple canos). The magnitude of oarthquakos is ofton moasured using the numeric Richter scale, which can be described as follows in a simplified manner Magnitude below 4 4 or more, but less than 6 6 or more, but less than7 7 or more, but less than 8 8 or more Description minor moderate strong major great Write a program that given the Richter magnitude (a positive floating-point number) as the input, prints a message as shown below. The answer box contains Pattern 4.4 (Case analysis: nested cases) as comments, to get you started. Write the corresponding code beneath each comment. Make each if-statement condition as simple as possible. Use variable names appropriate to the problem at hand instead of the generic names used by the pattern. The first step has been done for you. It uses an operation we defined for you, cet uD, to obtain the input used by each test. For example: Input Result # initialise the input values # if input values fall into the first case: # compute outputs according to the first # otherwise if inputs fall into the second a minor earthguake earthguake magnitude getinput) 1That is 3.9 That is a minor earthquake 4 That is a moderate earthquake. Case That is a strong earthquake. That is a major earthquake. hat is a case: # compute outputs according to the second case # otherwise if input falls into third case # compute outputs according to the third great earthqriake 8 case # etc. # otherwise: # compute outputs according to the last case # print the outputs

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!