Home / Expert Answers / Computer Science / how-do-you-code-in-python-earthquakes-are-measured-using-the-richter-scale-but-what-do-those-numbe-pa558

(Solved): how do you code in python? Earthquakes are measured using the Richter scale, but what do those numbe ...



how do you code in python?

Earthquakes are measured using the Richter scale, but what do those numbers actually mean? How much force is in a \( 5.5 \) e
Sample run 1
The earthquakes magnitude on the Richter scale: \( 1.0 \) A \( 1.0000 \) magnitude earthquake releases \( 1,995
Earthquakes are measured using the Richter scale, but what do those numbers actually mean? How much force is in a earthquake? In this program, you are going to convert the Richter scale value of a hypothetical earthquake to Joules (to measure its energy) then to what those Joules are equivalent to for comparison: - The earthquake's energy equivalent in metric tons of exploded TNT; - Approximately how many 1883 Krakatoa volcano eruptions the earthquake is equivalent to; and - Approximately how many Hiroshima bombs the earthquake is equivalent to. Constants for Conversion - The energy released in joules (which, by the way, represents the work done on an object when a force of 1 newton acts on that object) for a particular Richter scale, R, can be calculated as follows: ; - 1 metric ton of exploded TNT yields : - The 1883 Krakatoa volcanic eruption released of energy; and - The Little Boy atomic bomb dropped on Hiroshima in World War II released of energy. Specifications - Prompt the user for input "The earthquake's magnitude on the Richter scale:" and accept the input as a float. - If the user inputs a value less than 0 or greater than 13 , display the appropriate output as shown in the sample outputs. - Output how many joules that equals. - Output the equivalence in TNT explosions, Krakatoa eruptions, and Hiroshima bombings. - All output should have 4 decimal place precision and use commas appropriately. Constraints - You must have at least one subroutine; - Your output must be exactly the same as the output of the sample runs shown below; - You must comment your source code appropriately, include an informative header at the top, and use good coding style; - You must use meaningful variable names; - When displaying output, use the string format() function with string format specifiers. Sample run 1 The earthquake's magnitude on the Richter scale: A magnitude earthquake releases joules of energy. This is equivalent to metric tons of exploded TNT. This is equivalent to Krakatoa eruptions and Hiroshima bombs. Sample run 2 The earthquake's magnitude on the Richter scale: A magnitude earthquake releases joules of energy. This is equivalent to metric tons of exploded TNT. This is equivalent to eruptions and Hiroshima bombs. Sample run 3 The earthquake's magnitude on the Richter scale: A magnitude earthquake releases joules of energy This is equivalent to metric tons of exploded TNT. This is equivalent to Krakatoa eruptions and Hiroshima bombs. Sample run 4 The earthquake's magnitude on the Richter scale: Enter a positive value from 0 till 13. Sample run 5 The earthquake's magnitude on the Richter scale: Enter a positive value from 0 till 13 ,


We have an Answer from Expert

View Expert Answer

Expert Answer


#Function to calculate earthquake's energy in joules based on its Richter scale valuedef calculate_joules(R): return 10 ** ((1.5 * R) + 4.8)The fun
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe