Question: Program # 5 Concepts in Computer Science COP 2 5 0 0 Objectives 1 . To reinforce knowledge of if statements for conditional execution 2

Program #5Concepts in Computer Science COP 2500Objectives1. To reinforce knowledge of if statements for conditional execution2. To practice using both strings and integers as inputs3. To learn how to use while loopsIntroduction: Healthy UCFUCF is committed to student health and already has a great Recreation and Wellness center oncampus for students to use. To encourage students to find out more about themselves andtheir overall health, they are implementing some new initiatives.This semester, we will help the Healthy UCF program educate people about fitness, nutrition,heart rate, body mass index, and more through simple programs written in the pythonprogramming language.Problem: Heart Rate Monitor (heart.py)Most workout plans include at least three cardio workouts per week. For participants to get themaximum benefit from their cardio workouts, Healthy UCF wants a program that monitors howoften a participant is reaching their target heart rate.The target heart rate is 226 age for men and 220 age for women.In this program, we will ask the user which target heart rate we should use in our calculations.Then, participants should be asked to enter their recorded heart rates. Each heart rate will be aninteger and they should be entered one at a time. The final number will be a -1, to indicate thatthere are no more heart rates to be entered.The program should keep track of how many times the heart rate met or exceeded the targetheart rate and print this result to the user.Program SpecificationWe will ask the user which target heart rate to use and how old they are to determine a user-specific target heart rate. Then, we will allow the user to enter each recorded heart rate, one ata time.Your program must use a while loop with a reasonable condition for this input process.Your program may not use while True: for this loop.Your program may not use for loops.2Keep track of how many heart rates are entered and how many times the user met or exceededtheir specific target heart rate. After all the heart rates are entered, tell the user how many timesthey met or exceeded their target heart rate.Your program must include at least one if statement.Your program may not use a list, list functions, or functions that operate on iterables.Your program may not use include material outside of modules 1-2 and 4-5.Input SpecificationNOTE: 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. For the target heart rate formula, the user will enter either men or women2. The age will be a positive integer less than 100.3. Each heart rate will be a positive integer.4. The last integer will be -1 to indicate there are no more values. This integer is not a heart ratevalue.Output SpecificationRemember to match the phrases provided below and in the sample runs.Begin your program with the following prompts:Do you want to use the target heart rate for men or women?How old are you?Then, prompt the user to enter their heart rates with the following prompt. This prompt shouldbe printed only once.Please enter your recorded heart rates:When the user has finished entering their values, print a single line that tells them how manytimes they hit their target heart rate out of all the heart rates that they enter:You hit your target heart rate X times out of Y!Output SamplesBelow are some sample outputs of running the program. Note that these samples are NOT acomprehensive test. You should test your program with different data than is shown here basedon the specifications given above. In the sample run below, for clarity and ease of reading, theuser input is given in italics while the program output is in bold. (Note: When you actually runyour program no bold or italics should appear at all. These are simply used in this description forclaritys sake.)3Sample Run #1Do you want to use the target heart rate for men or women?womenHow old are you?27Please enter your recorded heart rates:200198180-1You hit your target heart rate 2 times out of 3!Sample Run #2Do you want to use the target heart rate for men or women?menHow old are you?25Please enter your recorded heart rates:200202199200201206198195190210-1You hit your target heart rate 4 times out of 10!Resource UsageRemember, all programming assignments must be your own unique work. You MAY use any resources provided through webcourses along with any notes you or Imake in class. You MAY use any resources provided through office hours by course staff (instructor,ULAs, and UTAs) You MAY NOT use any code provided to you outside the above sources. DO NOT use another student's code (this applies to both current and previous students) You MAY however discuss a solution idea at a high level with another student (e.g. I useda while loop in sentinel pattern) DO NOT use code from third party resources (online or offline).Style NotesPlease review the course Style Guide on the webcourse, with special attention to the followingnotes:4 the maximum length of a line of code is 80 characters long comment major sections of code addressing: What does this block do? and Why did Iimplement this block in this way? place comments above the line(s) to which it applies use inline comments (#) and leave one space between # and the comments firstcharacter capitalize the first letter of the comment give your variables meaningful names be consistent with spacing in arithmetic expressions keywords if and while should have a single space after themDeliverablesOne source file heart.py is to be submitted over WebCourses.RestrictionsAlthough you may use other environments, your program must run using IDLE. Your programshould include a header comment with the following information: your name, course andsection numbers, assignment title, and date. Also, make sure you include comments throughoutyour code describing the major steps in solving the problem.Grading DetailsYour programs will be graded upon the following criteria:1) Your correctness2) Your programming style and use of white space. Even if you have a plan and your programworks perfectly, if your programming style is poor or your use of white space is poor, you couldget 10% or 15% deducted from your grade.3) Compatibility to IDLE

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!