to write a program that calculates the number of calories you burn while exercis
ID: 3622303 • Letter: T
Question
to write a program that calculates the number of calories you burn while exercising. The program requires users to enter their weight, the distance travelled, and the elapsed time in minutes from the beginning of the exercise to the end. Users should be able to select from the following types of exercises: jogging, walking, swimming, and bicycling. After these values are entered, users should click a calculate button to display the results of the calorie calculation. A clear button should allow the users to enter a new set of values.Explanation / Answer
Here is the Pseudo part (I.E., The Hard part)... You just need to draw up the flow chart now using the pseudo code... Should take less than 5 minutes.
WRITE "Distance traveled: "
READ distTraveled
WRITE "Duration of exercise, In minutes: "
READ time
WRITE "Workout type: "
WRITE " [0] Jogging"
WRITE " [1] Walking"
WRITE " [2] Swimming"
WRITE " [3] Bicycling"
READ workout
caloriesBurned = 0
IF (workout == 0) THEN
use the REAL formula for calories burned here:
weight/(disTraveled*time*4)
ENDIF
IF (workout == 1) THEN
use the REAL formula for calories burned here:
weight/(disTraveled*time*54)
ENDIF
IF (workout == 2) THEN
use the REAL formula for calories burned here:
weight/(disTraveled*time*77)
ENDIF
IF (workout == 3) THEN
use the REAL formula for calories burned here:
weight/(disTraveled*time*123)
ENDIF
IF (workout > 3 THEN
WRITE "Error: Invalid Selection."
ENDIF
STOP
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.