Question: Write a method activityCalories that takes a string indicating an activity (sit, walk, jog, bike, swim) and duration in minutes (integer), and returns the
Write a method activityCalories that takes a string indicating an activity (sit, walk, jog, bike, swim) and duration in minutes (integer), and returns the estimated calories expended (double). Calories per minute for a 150 lb person (source): sit: 1.4 walk: 5.4 run: 13.0 bike: 6.8 swim: 8.7 If the input is sit 2, the output is 2.8 Hints: Use an if-else statement to determine the calories per minute for the given activity. Return the calories per minute times the minutes spent. 354538 2438654x3zay?
Step by Step Solution
3.41 Rating (151 Votes )
There are 3 Steps involved in it
public class CalorieCalculator public static double activityCaloriesString ... View full answer
Get step-by-step solutions from verified subject matter experts
