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...
-
A 0.50-mW laser produces a beam of light with a diameter of 1.5 mm. (a) What is the average intensity of this beam? (b) At what distance does a 150-W lightbulb have the same average intensity as that...
-
Actor Bank has an association with use case Withdraw with multiplicity 0..*. This means that Bank is involved with multiple Withdraw operations (a) sequentially (b) parallely (c) either (d) neither
-
Is it possible for the NPV of a project to be positive while the IRR is less than the discount rate? Explain.
-
Ruffalo Enterprises Inc. produces aeronautical navigation equipment. The stockholders equity accounts of Ruffalo Enterprises Inc., with balances on January 1, 2012, are as follows: Common Stock , $8...
-
Current Attempt in Progress At the end of its first year, the trial balance of Crane Company shows Equipment $33,000 and zero balances in Accumulated Depreciation-Equipment and Depreciation Expense....
-
Prepare an estate tax return (Form 706) for Marcia Miller, who died July 23, 2019. Marcia (born April 2, 1930) resided at 117 Brandywine Way, Eastern City, PA 19000 and was a lifelong Pennsylvania...
-
Diego's family car holds 14 gallons of fuel. Each day the vehicle uses 0.6 gallons of fuel. A warning light comes on when the remaining fuel is 1.5 gallons or less. a. Starting from a full tank, can...
-
On 1 / 1 / 2 0 1 5 , Tree Corp. purchased 8 0 % of the outstanding stock of Sloan Corp. for $ 5 0 0 , 0 0 0 cash. Tree Corp. determined that the fair value Sloan\'s net identifiable assets was $ 6 5...
-
Evaluate the integral. 9,2 r+8 dr
-
(c) Data Table 2 shows data taken in a free-fall experiment. Measurements were made of the distance of fall (19 at each of four precisely measured times. Complete the table. Use only the proper...
-
Seven Sages, LLC made $400,000 is sales during the month of July, of which 30% constituted cash sales. The remaining amount were sales made on credit. In August, sales on account totaled $300,000,...
-
Discuss your organizationscorporate, business and functional strategies. How does each general level of strategy relate to human resource management? If you are currently unemployed, you can research...
-
47. According refers to the USAP, what must be kept at leats 2 years after finality of a judicial proceeding? I. Copy of the appraisal report II. Workfile III. Other relevant annexes to the report a....
-
According to a New York Times columnist, The estate tax affects a surprisingly small number of people. In 2003, . . . just 1.25 percent of all deaths resulted in taxable estates, with most of them...
-
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...
-
Calculate \(60^{2} / 50\).
-
Correctly apply the rules for the order of operations to accurately compute the following: \(12 /(-4)+8 \times 9 / 12 \times 2^{3}-24 \times 25 / 10\).
-
Determine which of the following are rational numbers: 1. \(\sqrt{13}\) 2. \(-13 . \overline{21}\) 3. \(\frac{-48}{-16}\) 4. \(-4 \frac{18}{19}\) 5. 14.1131
Study smarter with the SolutionInn App