Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a method activityCalories that takes a string indicating an activity (sit, walk, jog, bike, swim) and duration in minutes (integer), and returns the

image text in transcribed 

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

Step: 1

public class CalorieCalculator public static double activityCaloriesString ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Managing Business Process Flows Principles of Operations Management

Authors: Ravi Anupindi, Sunil Chopra, Sudhakar Deshmukh, Jan Van Mieg

3rd edition

136036376, 978-0136036371

More Books

Students also viewed these Programming questions