Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a C program that must be structured as a main function and ahelper (user-d

ID: 3617630 • Letter: W

Question

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; }
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote