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
Get step-by-step solutions from verified subject matter experts
