Question: a) Write a program to create a workout plan. This will involve displaying exercises, generating exercise times, displaying the workout plan, and then determining
a) Write a program to create a workout plan. This will involve displaying exercises, generating exercise times, displaying the workout plan, and then determining the total time spent exercising. Assume the exercise plan will always consist of at least one exercise. Here are the criteria: Your program "L7Q1initials.py" must start with a commented pledge, ID Box, and program purpose. EACH of the five functions including the main function must state its purpose in comments. The main function in your program must be named: make provided for you. Copy this function into your program Pour program def make workout plan (exercises): display_exercises (exercises) to int y law. kout plan. It has been s written: adet sjogrity Por intellect times generate_times display_plan(exercises, calc_total_time (times) make_workout plan calls FOUR different helper functions. As you write your program, test each function individually with different function calls. Only move on to the next function once you are certain that your current function works. Here are the helper specifications: s (exercises): displayer wa Print the its list to perform displaying each entry in the exercises list with times (exercises): e a list of randomly generated integers to represent the amount of time in generasion. Refer to the screenshot for format details. Distribution of reale to spend on each exercise. Each randomly generated number will be between 5 and ten times the amount of exercises in the exercises list. For this, you must use import random and random.randint appropriately. Print the list before returning it. display_plan (exercises, times): Print the workout plan showing each exercise from the exercise list with its corresponding amount of minutes from the times list. calc_total_time (times) : Calculate the total time spent exercising using the times list. Display the time in minutes and hours/minutes format. Refer to the screenshot for details. The sample output provided shows you two example runs. Your output should be similar but reflect the exercises provided and the randomly selected tim es generated by your program. >>> make_workout_plan(["Running", "Swimming", "Cycling"]) Today's exercises: -> Exercise 0: Running -> Exercise 1: Swimming -> Exercise 2: Cycling Generating time (5 to 30 minutes) for each exercise: [18, 26, Workout plan: -> Running for 18 minutes -> Swimming for 26 minutes -> Cycling for 20 minutes Total time spent exercising: 64 minutes which is 1 hour(s) and 4 >>> make_workout_plan(["Walking", "Rowing", Today's exercises: -> Exercise 0: Walking -> Exercise 1: Rowing -> Exercise 2: Boxing -> Exercise 3: Basketball -> Exercise 4: Dancing Generating time (5 50 minutes) for each exercise: [14, 9, 37, 22, 50] plate MacEwan's Student Acade e Inity Policy and intellectual property law. Workout plan: -> Walking for minutes -> Rowing for 9 minutes -> Boxing for 37 minutes ->Bask for 22 minutes oxing", "Basketball", "Dancing"]) for 50 minutes time spent exercising: 132 minutes which is 2 hour(s) and 12 minute(s) b) Save the program as "L7Qlinitials.py" replacing initials with your actual initials. c) Submit your program electronically for marking. 2
Step by Step Solution
3.46 Rating (149 Votes )
There are 3 Steps involved in it
Python program that implements the workout plan according to the provided specifications python impo... View full answer
Get step-by-step solutions from verified subject matter experts
