Question
make gym activity calories calculator app in c#. Change the caption for the form to Gym Activities Calories Calculator App. It appears at the middle
make gym activity calories calculator app in c#.
Change the caption for the form to Gym Activities Calories Calculator App.
It appears at the middle of the screen when you run the application.
The user cannot change the size of the form during run mode.
The default button (that is when you click the Return button) is the button to calculate miles and the cancel button (that is when you click the Esc button) is the exit button.
Writing the codes:
Based on a report from Harvard Health Publishing, the calories burned (for a person weighing 185 pounds) for each activity is as shown below. Use named constants to capture calories burned per minute.
Stair Step Machine: general 266 per 30 minutes
Elliptical Trainer: general 400 per 30 minutes
Ski Machine: general 422 per 30 minutes
Calculate:
) Use a Try Catch to handle any data exceptions.
The number of minutes for each activity is entered. Use appropriate variables to get these inputs from the user.
Calculate the calories burned for each activity as follows:
2 Calories burned = number of minutes (activity) * constant calories burned per minute for that activity. e.g. if minutes entered for Stair Step Machine is 30 minutes, calories burned = 30 * (266/30) = 266
Display the output calories burned to 1 decimal place.
Calculate the total calories burned by adding all the calories burned.
Display the total calories burned in label10 as follows: Total calories burned for all activities = calculated total calories (where calculated total calories is the total calories displayed to 1 decimal place).
If there are any errors in the inputs, display an appropriate message for the user to correct the inputs. Reset the form and place the cursor in textbox1. Write the code for the Reset button to:
Clear the input and output textboxes.
Set the cursor at textbox1 (Number of Minutes Stair Step Machine). Write the code for the Exit button to quit the application
stair step machine Eliptical trainer Ski machine
numbers of minutes: numbers of minutes: number of minutes:
calories burned: calories burned: calories burned:
label for result
calculate reset exit
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started