lab8 - /Tom Nanke /CIS 150-001 /10/30/07 /Lab #8 /This...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
//Tom Nanke //CIS 150-001 //10/30/07 //Lab #8 //This program tests whether or not somebody, after running for 15 minutes and //taking their pulse for 6 seconds, is inside of their pulse rate target zone. / #include<iostream> # using namespace std; u //Function prototype bool InTheZone(int &age, float &pulseRate); b int age; //The age that the user enters float pulseRate; //The pulse rate that the user enters int maximalHeartRate; //The persons maximal heart rate, which is 220 less the person's age p int main() { cout<<"When you want to stop the program, enter a negative value for age or pulse rate."<<endl; cout<<"Enter your age."<<endl; cin>>age; cout<<"Enter your six-second pulse rate."<<endl; cin>>pulseRate; cout<<endl; c while(age>=0 && pulseRate>=0) //loop will exit when user enters a negative number { InTheZone(age,pulseRate); //function call / if(InTheZone(age,pulseRate)==true) //if InTheZone returns true cout<<"You are in your target zone."<<endl<<endl; c else //if InTheZone returns false
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

lab8 - /Tom Nanke /CIS 150-001 /10/30/07 /Lab #8 /This...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online