Question: For a Button object named btnCalories, write the click event handler to implement the following requirements and calculate the number of calories burned during a
For a Button object named btnCalories, write the click event handler to implement the following requirements and calculate the number of calories burned during a run:
a. Declare variables named strMilesRan, decCaloriesConsumed, and decMilesRan.
b. Declare a constant named _cdecCaloriesBurnedPerHour and assign it the value 700. (Assume you burn 700 calories for every mile you run.)
c. Allow the user to enter the number of miles she ran today.
d. Convert the number of miles to a Decimal data type.
e. Calculate the number of calories the user burned during her run.
f. Display the result rounded to zero decimal places in a label named lblCaloriesBurned.
Step by Step Solution
3.37 Rating (147 Votes )
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
