//-------------------------------------------------------------------- // heart.cpp computes a person's target heart rate zone using formulas // Input: Person's age in years // Output : Lower and upper limits of target heart rate zone in bpm // Programmer: Mark Cruz // AP IB Computer Science // 9/30/2002 // 2B //-------------------------------------------------------------------- #include #include int main() { cout << "Enter your approximate age in years: "; double age; cin >> age; double lower = .60*(220-age); double upper = .75*(220-age); cout << "\nThe upper limit of your target heart rate zone is " << upper << " beats per minute. \n " ; cout << "\nThe lower limit of your target heart rate zone is " << lower << " beats per minute. \n " ; return 0; } /************************************************************************ Enter your approximate age in years: 17 The upper limit of your target heart rate zone is 152.25 beats per minute. The lower limit of your target heart rate zone is 121.8 beats per minute. Press any key to continue Enter your approximate age in years: 25 The upper limit of your target heart rate zone is 146.25 beats per minute. The lower limit of your target heart rate zone is 117 beats per minute. Press any key to continue Enter your approximate age in years: 50 The upper limit of your target heart rate zone is 127.5 beats per minute. The lower limit of your target heart rate zone is 102 beats per minute. Press any key to continue Enter your approximate age in years: 90 The upper limit of your target heart rate zone is 97.5 beats per minute. The lower limit of your target heart rate zone is 78 beats per minute. Press any key to continue *************************************************************************/