Question: Write a script file prompts a user for the three sides of a triangle (a, b, and c) and uses the law of cosines to

 Write a script file prompts a user for the three sides

Write a script file prompts a user for the three sides of a triangle (a, b, and c) and uses the law of cosines to find the angles (A, B, and C). cos(C) = a^2 + b^2 -c^2/2ab cos(A) = b^2 + c^2 - a^2/2bv cos (B) = c^2 + a^2 - b^2/2ca Use print statements to print the sides a, b, and c and the angles in degrees A, B, and C. The energy in joules released for a particular Richter scale measurement is given by: E = 10^(1-5*r)+4.8 where E is energy measured in joules and r is the Richter scale measurement (typically on a scale from 1-10 as a floating point number). One ton of exploded TNT yields 4.184 times 10^9 joules. Thus, you can relate the energy released in joules to tons of exploded TNT. For each of the following Richter scale measurements (set up a for loop), your python script will perform the appropriate calculations and display the equivalent amount of energy in joules and in tons of exploded TNT using a series of print statements: 1.0 5.0 9.1(Indonesia earthquake, 2004) 9.2(Alaska earthquake, 1964) 9.5 (Chile earthquake, 1960; largest ever measured)

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!