a) Write a program to create a workout plan. This will involve displaying exercises, generating exercise...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Answer rating: 100% (QA)
Python program that implements the workout plan according to the provided specifications python impo... View the full answer
Related Book For
Spreadsheet Modeling & Decision Analysis A Practical Introduction to Management Science
ISBN: 978-0324656633
5th edition
Authors: Cliff T. Ragsdale
Posted Date:
Students also viewed these programming questions
-
Consider the following function. k(x) = (x-1) - 4 Step 2 of 4: Find the x-intercepts, if any. Express the intercept(s) as ordered pair(s).
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Modify your Digraph class from the previous exercise to make a MultiDigraph class that allows parallel edges. For a test client, run a random- surfer simulation that matches RandomSurfer (Program...
-
An in order tree walk of an n-node binary search tree can be implemented by finding the minimum element in the tree with TREE-MINIMUM and then making n-1 calls to TREESUCCESSOR. Prove that this...
-
Why does Law of Demand and Supply contribute to profit-maximizing management decision-making?
-
Two-Way Analysis of Variance. Suppose that two different sets of treatments are of interest. Let \(y_{i j k}\) be the \(k\) th observation level \(i\) of the first treatment type and level \(j\) of...
-
Consider the data in Figure for Daisys Dance Studio: Adjustment Data a. Insurance expired, $100. b. Dance supplies on hand, $1,100. c. Depreciation on dance equipment, $2,000. d. Salaries earned by...
-
Pore Networks in Membranes. (20 pts) Consider two membranes below, with equal void space, but differently configured. The membrane on the left consists of a narrow and a wide pore in parallel, while...
-
Alex Yeoman Painting Co. of Yellowknife uses a purchases journal (page 21) and a general journal (page 32) to record the following transactions. The GST rate is 5%. The paint store has decided to...
-
The table shows Maxs, Igors, and Lizas demand schedules for potatoes. Assume that Max, Igor, and Liza comprise the entire market and complete the table by calculating the market demand schedule....
-
It was a cool B2B business idea. While working at Liz Claiborne, David Reinke had the idea to use crowdsourcing to help retailers select the womens clothing they would feature in their stores....
-
What is the Random Walk Hypothesis (RWH)? Is there any evidence against this hypothesis?
-
What is a risk premium on an investment?
-
Under the efficient markets hypothesis (EMH), what are the three types of market efficiency? Briefly describe them.
-
Give three characteristics of a perfect capital market and briefly discuss them.
-
Question 17 (1 point) Back emf in case of synchronous motor depends on the both (a) and (b) (b) speed ONeither (a) nor (b) O(a) excitation given to the field winding
-
How is use of the word consistent helpful in fraud reports?
-
a. Develop a decision tree for your decision problem. b. What is the EMV of harvesting and bringing the crop to market? c. Would you bring this crop to market or plow it under like your neighbor? d....
-
Fred and Sally Merrit recently inherited a substantial amount of money from a deceased relative. They want to use part of this money to establish an account to pay for their daughters college...
-
Use Holts method to create a model that minimizes the MSE for the data set. Use Solver to determine the optimal values of and . a. What are the optimal values of and ? b. Prepare a line graph...
-
W hat is diauxic growth? Explain the roles of cAMP and CAP in this process.
-
What is antisense RNA? How does it affect the translation of a complementary mRNA?
-
What are the functions of activator proteins and repressor proteins in transcription? Explain how these proteins work at the molecular level.
Study smarter with the SolutionInn App