Question: Can someone help me make this into a do while loop in java. public static void lightOrHeavy(int theNum, Scanner kb) The lightOrHeavy method calculates the
Can someone help me make this into a do while loop in java.
public static void lightOrHeavy(int theNum, Scanner kb)
The lightOrHeavy method calculates the average of the number passed in. Take the sum of the digits and divide by the total number of numbers in the number passed in. Next prompt the user for a second number. Take the sum of the digits and divide by the total number of numbers in the number entered. If the average of the number passed in is greater than the average of the second number than the number is heavy otherwise it is light. @NOTE: The input buffer will be left cleared before leaving the method
Parameters:
theNum - Representing a number in range
kb - Representing the Scanner to the keyboard
Throws:
IllegalArgumentException - if theNum is out of range
IllegalArgumentException - if the Scanner is null
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
