Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part 3 only please Lab2Activity.pdf- Mozilla Firefox epl.it Online Nodej... x Lab2Activity pdf | c IQ. Search Automatic Zoom Understanding how to call a lunction

image text in transcribedPart 3 only please
image text in transcribed
Lab2Activity.pdf- Mozilla Firefox epl.it Online Nodej... x Lab2Activity pdf | c IQ. Search Automatic Zoom Understanding how to call a lunction ts only halif the battle, you need to undorstand what the functions do. Translate the function 'green eggs' into a control flow diagram. Part 2: Exercise is considered to be a healthy part of life, and each type of exercise burns a different amount of calories. Fran wants to choose an exercise program that will provide the most calories burned. Through the research on the internet, Fran found two options that have stretching, cardiovascular activity, and working with weights. You are going to help Fran figure out which program will be a better choice. Through this process, you should be submiting to Autolab after each part is complete. This is a way to make sure that your work is saved. It is also an approach to make sure that you are fully testing each part before moving on to the next. AutoLab will count the grade of only the final submission towards your grade Part 2a: (5 Points) In order to help Fran, the amount of calories burned in a given program needs to be calculated. Create a function called 'cal burn' that calculates and returns the total calories burned based on the amount of time spent on each of the exercise methods. Your'cal burn function has three parameters: the first is the time spent stretching, second is the time doing cardiovascular activity, and finally is the time spent working with weights. The times for each exercise will be inputted as minutes. The amount of calories that are burned with each method are found in the following table: Method Stretching Cardiovascular Activity Working with Weights Calories Burned Every 60 Minutes 300 450 133 Return the total number calories burned for that exercise plan. Lab2Activity.pdf-Mozilla Firefox Repl.it Online Nodej... Lab2Activity.pdf c Q Search Part 2b: (5 Points) To help Fran make a decision, a function is needed to determine which program will burn the most calories. This is going to be done with a function called 'most cal. This function will take in two parameters that correspond to the amount of calories for program 1 and program 2. This function will return a 1 if program 1 burns the most calories, 2 if program 2 burns the most calories, and 3 if they burn the same amount of calories. Part 3: (8 Points) Now it is time to put together the functions created in part 2 to determine which exercise combination Fran should choose. Create a main function called 'exercise_choice that has six integer inputs that represent how many minutes are spent on each exercise activity for two separate plans. The input order will be first three inputs for combination one, then the next three for combination two; with each combination in the order of stretching, then cardiovascular, then weights. You will then return the value telling which program burns the most calories; 1 for plan 1, 2 for plan 2 and 3 if they are equal. To verify that Jour program is working appropriately before you submit, we recommend you test it by printing out the result of which combination of exercises will burn the most calories When this is complete, submit it to AutoLab

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

Step: 3

blur-text-image

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

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions