Question: Need help to code this please ASPS. I will rate you. Part 1) Write a Java program to calculate the weights of the objects. The

Need help to code this please ASPS. I will rate you.

Need help to code this please ASPS. I will rate you. Part

Part 1) Write a Java program to calculate the weights of the objects. The program does the following (a) Read an object's name from the user (b) Get the object's mass from the user. Display the object's name when asking for the mass (See Part 2 for sample output) (c) Calculate the weight with the following formula: weight-mass* 9.8 (d) Write an if statement that checks the weight. If weight> 1000 Newtons, display "objectName is too heavy!" (Where object name is the name input at step a) If the object weighs less than 10, display "objectName is too light!" Otherwise, display "objectName weighs X", where X is the weight from part c 1. 2. 3. (e) Verify that your code works for all three cases before moving on. Part 2) This part extends the code from Part 1 into a loop (10 points) (a) Take the code from part 1 and put it into a while loop. The while loop should run until the user inputs a -5, at which point the while loop should end. In this case, the input is a 'sentinel value'. Note: you will have to get the first object's name and first mass outside of the loop for things to work. (b) The input that ends the loop should be the object's mass, not the object's name, to prevent the need to convert data types

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!