Question
You can calculate your maximum safe heart rate by subtracting your age from 220. For example, if youre 45 years old, subtract 45 from 220
You can calculate your maximum safe heart rate by subtracting your age from 220. For example, if youre 45 years old, subtract 45 from 220 to get a maximum heart rate of 175. If you are 20 year old, maximum safe heart rate will be 200. This is the average maximum number of times your heart should beat per minute during exercise.
Reference: Mayo Clinic
Let us say you wore a smart-watch and went for a run! Let us assume that your watch has captured your heart rate periodically and saved it as a series of data points in a file. Write a program to accept your age as the first input and a filename as the second input. Your program should open that data file, read the series of data and find % of the data points that are below the maximum safe heart rate. Here is a sample input and output (output % should have exactly one fractional digit):
20 run1.txt 96.9%
IN C++ PLEASE
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started