Question: ics 212 Objective - Create a program that will calculate a person's target heart-rate for exercising given their year of birth and the current year.

ics 212
ics 212 Objective - Create a program that will calculate a person's
target heart-rate for exercising given their year of birth and the current
year. - Work with symbolic constants, conversion (format) specifiers, and puts ()

Objective - Create a program that will calculate a person's target heart-rate for exercising given their year of birth and the current year. - Work with symbolic constants, conversion (format) specifiers, and puts () function. Related SLO: - Develop properly structured multifile programs with automatic compilation. Instructions. - For file management purposes, you may want to create separate folders for each programming assignment. - Create a program named LastnameFirstnameo5. c, that does the following: 1. Ensure your program is able to use the custom getdouble () function from the example code. - To use the getdouble () function, you need the files: getdouble,c, getdouble.h, and makeftledouble. - Download each fite by right-clicking on each link above and Save link As... - After downloading each file to your computer, upload it to your uhunix account and ensure the files are in the same directory as your LastnameFirstname05. c program. - Use emacs to edit makefile-double so that it will compile and link getdouble.c, getdouble.h, and LastnameFirstname05.c. In other words, you want to replace all instances of inputdouble with LastnameFirstname05. - Save makefile-double. 2. Add the following include statement at the top of your program: \#include "getdouble.h" 3. Define and use at least 1 symbolic constant with \#define - It is up to you to decide what you want to be a constant. You may need to come back to this bullet later. 4. Use at least 1 puts () function call. - It is up to you what you want to print using puts(). 5. Use int for all numeric variable types, this will make the calculations and output simpler. 6. Output a message telling the user what this program does. 7. Ask the user to enter their birth year. 8. Use the custom getdouble () function to get the birth year and store the year in an int variable. - Typecast the return value to store it in an int variable. For example: birthyear = (int) getdouble(); 9. Ask the user to enter the current year and repeat the same process to get the current year. 10. Calculate the user's age using the following formula: - Age = Current Year - Birth Year 11. Calculate the user's maximum heart rate (in beats per minute) using the following formula: - Maximum heart rate =220 - age 11. Calculate the user's maximum heart rate (in beats per minute) using - Maximum heart rate =220 - age - That is, 220 minus age 12. Finally, the target heart-rate is the range 50% to 85% of the maximum heart rate. Use the following formulas: - Lower target = Maximum heart rate 0.50 - Upper target = Maximum heart rate * 0.85 13. Print out the user's age, their maximum heart-rate, and their target heart-rate with appropriate labels. 14. Double-check that you used at least 1 symbolic constant and 1 puts() function call. 15. At the end of the main function, be sure to return 0 ; - Moving forward, this applies to all assignments, regardless if it is stated in the instructions or not. - Since main is declared as an int function, it should return an int at some point. It is customary to return 0 ; at the end of main. 0 is a value signaling that the program terminated successfully. Any non-zero value would indicate that the program was not successful or that an error occurred. 16. Be sure to have a program description at the top and in-line comments. 17. Code adheres to the coding standard. 18. Be sure to have read through the assignment policy for this class. - Example Output i make -f makefile-double 1. /program This program will calculate your target heart-rate for exercising. Bnter the year you were born: 2005 Enter the current year: 2023 Your age is: 18 Your maximum heart-rate is: 202 Your target heart-rate is between 101 and 171 beats per minute. 1. /program This program will calculate your target heart-rate for exercising. Enter the year you were bornt 1988 Enter the current year: 2023 Your age ist 35 Your maximum heart-rate is: 185 Your target heart-rate is between 92 and 157 beats per minute. - /program This program will calculate your target heart-rate for exercising. Enter the year you were born: 1975 of make -f makefile-double of ./program This program will calculate your target heart-rate for exercising. Enter the year you were born: 2005 Enter the current year: 2023 Your age is: 18 Your maximum heart-rate is: 202 Your target heart-rate is between 101 and 171 beats per minute. \%. /program This program will calculate your target heart-rate for exercising. Enter the year you were born: 1988 Enter the current year: 2023 Your age is: 35 Your maximum heart-rate is: 185 Your target heart-rate is between 92 and 157 beats per minute. \&. /program This program will calculate your target heart-rate for exercising. Enter the year you were born: 1975 Enter the current year: 2020 Your age is: 45 Your maximum heart-rate is: 175 Your target heart-rate is between 87 and 148 beats per minute. - Hints - In my solution, I used the following: - 2 symbolic constants - 6 int variables

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!