-
"should be 148 but its giving me a answer of 180 how can i fix this so it gives me a answer of 148"
With an age = 20, and resting rate of 70...
maxHR = 220 - age (= 200)
HRreserve = maxHR - restingRate (= 130)
LowTrainRate = CInt(HRreserve * 0.5 + restingRate)
UpperTrainRate = CInt(HRreserve * 0.85 + restingRate)
If flag = True Then
TrainingHeartRate = UpperTrainRate = 130 * 0.85 = 110.5 + 70 = 180.5
You have set the flag as true...the answer is UpperTrainRate, which = 180 (it is an integer)
If the flag is False...the answer is LowerTrainRate = 130 * 0.5 = 65 + 70 = 135
NEITHER returns 148. You fix it by doing better math. As you have it, the answer of 180 is totally correct. Hey, YOU coded it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules