Question: Write a Java program that calculates the total weight of a group of objects. Do this by prompting the user to enter the average weight

Write a Java program that calculates the total weight of a group of objects. Do this by prompting the user to enter the average weight then the number of items. Read in the average weight as a real number (double) and the number of items as a whole number (int). Use a (single) Scanner object to read these values from the user. Multiple the values together and display their product.

Example 1:

Please enter the average weight: 1.75 Please enter the number of items: 2 The total weight is 3.5

Example 2:

Please enter the average weight: 0.2 Please enter the number of items: 11 The total weight is 2.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!