/* Program: Heartbeats Programmer : Jason Gradziel */ #include #include #include void setup(void); void process(void); void wrapup(void); int years, months, days; unsigned long beats; void main(void) { setup(); process(); wrapup(); } void setup(void) { clrscr(); printf("\n\n\n\n\n\t\tHow old are you ?: "); scanf("%d",&years); printf("\n\t\tHow many months has it been"); printf("\n\t\tsince your last birthday? : "); scanf("%d", &months); printf("\n\t\tWhat is day is it today? : "); scanf("%d", &days); } void process(void) { beats = ((years * 525600) + (months * 43200) + (days * 140))* 80; } void wrapup(void) { printf("\n\n\tYour heart has more than %lu times so far!",beats); if (years > 40) printf("\n\n\t\tSure hope you're HEARTSMART!!"); else printf("\n\n\t\tLots more beats in this ticker!!"); getche(); clrscr(); for (int a=0; a<10; a++) { printf("\n\n\n\n\n\n\n\n\t\t\t\tBYE BYE!!"); delay(200); clrscr(); delay(200); } }