Question: Create an Java application that determines gravitational potential energy in joules for 3 objects based upon their inputted height (in meters, and the ground is

Create an Java application that determines gravitational potential energy in joules for 3 objects based upon their inputted height (in meters, and the ground is considered to be a zero height position.) and relevant mass (in kg).

The output window displays all 3 in order from largest gravitational potential energy to smallest with each formula and calculation result.

Inputs

Ask for a descriptive name of each of the three objects

Utilize the inputted objects name (from the above bullet) when asking for each objects height in meters and mass in kilograms (must accept 2 decimal points)

All inputs to be done via JOptionPane class

Check that each of the object nameinput is a valid entry (not blank) and if not, display an invalid data entry message and end the application (System.exit(0); code line will end the application)

Outputs

Order all objects and all of their relevant output from the largest calculated potential energy value to the smallest

For each object display and output the formula utilized to calculate the results with the inputted values displayed in their relevant position; i.e. PE = 12.75kg * 9.8m/sec2* 22.35m (display 2 decimal points)

Show the calculated gravitational potential energy value in joules for each object (display 2 decimal points)

All object descriptions should utilize the relevant name inputted by the user

All output is to be formatted clearly and shown on one JOptionPane output message box

Numeric format

All numeric inputs and outputs must accommodate and display 2 digits after the decimal point

Information

Gravitational Potential Energy Formula (in joules): Potential Energy = m *g * h

Where m is the mass of the object in kilograms

Where h is the height of the object in meters

Where g is the gravitational constant equal to 9.8 m/sec 2

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!