Question: This is done with Java from the book Absolute Java: ISBN: 9780134041674 The text book solutions questions and answers are not consistent with what our

This is done with Java from the book Absolute Java: ISBN: 9780134041674 The text book solutions questions and answers are not consistent with what our assignments and questions have been.

Weight is defined as the gravitational force acting on the mass of a body. The weight of a body with a mass of 1kg on Earth can be calculated with the formula given below. The weight is expressed in Newtons (N). Weight on earth = (1 kg) * (9.81 m/s2) = 9.81 N

The weight of the same body in N can be calculated with another formula: Weight on moon = ((1 kg) * (9.81 m/s2)) / 6 = 1.64 N

Write a program that takes as input the mass of a car in kilograms and then prompts the user to choose to calculate the cars weight in Newtons either on Earth or on the Moon. The program should allow the user to enter new values and output the cars weight on Earth or on the Moon till the user decides to exit. Use the double data type to store the mass.

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!