Hi: I do not know where to start in this. I know I\'m suppose to use pointers th
ID: 3617644 • Letter: H
Question
Hi:
I do not know where to start in this.
I know I'm suppose to use pointers that refer to my helperfunction,I know I'm suppose to ask for the birthday and the datetoday and find out how many minutes that is and multiply it by 72.here is the requirements, what should i do in my helperfunction?
Write a C program that must be structured as a main function and ahelper (user-defined) function.
The helper (user-defined) function must calculate the number ofheartbeats you had in your lifetime so far depending
on your age. The function must produce two "results" as it may bebetween 0 to 365 days to your next birthday, taking
the time from 12 noon on the day that you were born (deal with daysonly). One result must be returned (true result),
the other one though a pointer (fake result) or looked at anotherway, one value is returned and the other obtained by
the main function through the use of a pointer with the helperfunction. So, your function will use your age and
calculate the range of heartbeats. Assume a heart rate of 72 beatsper minute.
The main function will ask the user for the age, call the functionand display the ranges of heartbeats.
Note: The computation may produce incorrect results due toarithmetic overflow. It is safer to use doubles than
integers.
Explanation / Answer
please rate-thanks #include #include double getHeartbeats(int,double* ); int main() {int age; double a,b; printf("How old are you? "); scanf("%d",&age); a=getHeartbeats(age,&b); printf("the number of heartbeats you've had is between: %.0f and%.0f ",a,b); getch(); return 0; } double getHeartbeats(int age,double* b) {int daysalive; double beats; daysalive=365*age; beats=daysalive*72; *b=(daysalive+365)*72; return beats; }Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.