- Objective: Become familiar with C++ syntax. Become familiar with writing functions.
- Overview: This application will interact with the user by inputting workout information and then processing that information and displaying the results to the user.
Write a program that will:
- Welcome the User to your app
- Prompt the user for the number of steps walked/or ran during a workout (integer)
- Prompt the user for their average stride length in inches (double)
- Invoke a function called convertDistance
- Function will have two arguments
- Steps walked
- Stride Length
- Calculate the distance of the workout to miles (1 mile = 63360 inches, define a c++ constant to use this value)
- Function will return Distance in Miles a double
- Function will have two arguments
- Invoke a function called printWorkout
- Function will have three arguments
- Steps walked
- Stride Length
- Function will have three arguments
- Distance in miles
- Display all the data
- Steps walked
- Stride Length (display 2 decimals)
- Miles covered (display 3 decimals)
- Function will not return anything
- Keeps a running total of distance covered in miles
- Keeps the length of the longest workout in miles
- Prompt the user to enter another workout
- If another workout is to be entered then repeat steps 2 -8.
- If no more workouts are to be entered, then
- Invoke a function called printWrapUp
- Function will have 2 arguments
- Total in Miles of all Workouts
- Longest Single Workout
- Display the
- Total in Miles of all workouts
- longest single workout
- Function will have 2 arguments
- Invoke a function called printWrapUp
- Thank the user.
Follow good programming and readability guidelines as covered in class.
Reviews
There are no reviews yet.