Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem: Set Tracking ( sets . py ) Most workout plans include some form of strength training. During a strength training workout, participants will track

Problem: Set Tracking (sets.py)
Most workout plans include some form of strength training. During a strength training workout,
participants will track the number of sets they complete and the number of repetitions per set
for that exercise.
In this program, we want to assist the user by tracking the average number of repetitions across
their sets for each workout they want to enter data for.
Program Specification
We will start by asking the user how many workouts they want to enter data for. Then, for each
workout, ask the user how many sets were completed. Then, for each set, ask the user how
many repetitions were completed.
Your program must use nested for loops with reasonable ranges for this input process.
Your program may not use while loops.
When all of the information is entered for the workout, tell the user the average number of
repetitions for that workout.
Your program may not use a list, list functions, or functions that operate on iterables.
Your program may not define functions.
Your program may not include material outside of modules 1-2 and 4-5.
2
Input Specification
NOTE: Input specifications guarantee that whoever uses your program, including the graders,
will adhere to these specifications. This means that you do not need to check for them.
1. The number of workouts will be a positive integer.
2. The number of sets will be a positive integer.
3. The number of repetitions will be a positive integer.
Output Specification
Remember to match the phrases provided below and in the sample runs.
Begin your program with the following prompt:
How many workouts do you have data for?
Then, for each workout, prompt the user with:
How many sets were completed in workout #X?
Then, for each set, prompt the user with:
How many repetitions in set #Y?
At the end of each workout output the average number of repetitions for that workout to three
decimal places.
Workout #X: The average number of repetitions was Z.ZZZ.
Output note: Use Pythons round function to control your outputs precision. Remember that
when using this function, you may have fewer decimal places in your result. This is fine. You may
not have more than 3 decimal places in your output.
Output Samples
Below are some sample outputs of running the program. Note that these samples are NOT a
comprehensive test. You should test your program with different data than is shown here based
on the specifications given above. In the sample run below, for clarity and ease of reading, the
user input is given in italics while the program output is in bold. (Note: When you actually run
your program no bold or italics should appear at all. These are simply used in this description for
claritys sake.)
Sample Run #1
How many workouts do you have data for?
3
How many sets were completed in workout #1?
2
How many repetitions in set #1?
10
3
How many repetitions in set #2?
15
Workout #1: The average number of repetitions was 12.5.
How many sets were completed in workout #2?
3
How many repetitions in set #1?
9
How many repetitions in set #2?
12
How many repetitions in set #3?
13
Workout #2: The average number of repetitions was 11.333.
How many sets were completed in workout #3?
3
How many repetitions in set #1?
10
How many repetitions in set #2?
12
How many repetitions in set #3?
14
Workout #3: The average number of repetitions was 12.0.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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_2

Step: 3

blur-text-image_3

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

User Defined Tensor Data Analysis

Authors: Bin Dong ,Kesheng Wu ,Suren Byna

1st Edition

3030707490, 978-3030707491

More Books

Students also viewed these Databases questions