1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ipatiy [6.2K]
3 years ago
10

Write a program that calculates an adult's fat-burning heart rate, which is 70% of 220 minus the person's age. Complete fat_burn

ing_heart_rate() to calculate the fat burning heart rate. The adult's age must be between the ages of 18 and 75 inclusive. If the age entered is not in this range, raise a ValueError exception in get_age() with the message "Invalid age." Handle the exception in __main__ and print the ValueError message along with "Could not calculate heart rate info." Ex: If the input is: 35 the output is: Fat burning heart rate for a 35 year-old: 129.5 bpm If the input is: 17 the output is: Invalid age. Could not calculate heart rate info.
Computers and Technology
1 answer:
gayaneshka [121]3 years ago
8 0

Answer:

#include <iostream>

# include <conio.h>

using namespace std;

float fat_burning_heart_rate(float age);

main()

{

float age,bpm;

cout<<"enter the age of the person"<<endl;

cin>>age;

if (age>=18 && age<=75)

{

bpm=fat_burning_heart_rate(age);

cout<<"fat burning heart rate for the age of"<<age<<"="<<bpm;

}

else

cout<<"Invalid age";

getch();

}

float fat_burning_heart_rate(float age)

{

 

float a;

 

a= (220-age)*0.7;

return a;

}

Explanation:

In this program, the variable named as age has been taken to enter the age of the person, needs to calculate the burning heart rate. All the variables taken in float, as the age and fat burning heart rate should come in decimal value.

The formula has been used as mention in question that,

a= (220-age)*0.7;

You might be interested in
Given two objects represented by the tuples (22, 1, 42, 10) and (20, 0, 36, 8):
Rudik [331]

Answer:

Given,

P = (22, 1, 42, 10)

Q = (20, 0, 36, 8)

a. Formula for Euclidean Distance :

distance = ((p1-q1)^2 + (p2-q2)^2 + ... + (pn-qn)^2)^(1/2)

Now,

distance = ( (22-20)^2 + (1-0)^2 + (42 - 36)^2 + (10-8)^2) ) ^(1/2)

=( (2)^2 + (1)^2 + (6)^2 + (2)^2 ) ) ^(1/2)

=(4+1+36+4)^(1/2)

=45^(1/2)

Distance = 6.7082

b.Manhattan distance :

d = |x1 - x2| + |y1 - y2|

d = |22- 20| + |1 - 0|

d = |2| + |1|

Explanation:

4 0
2 years ago
1. Discuss the pros and cons of human-computer interaction technology?
Lana71 [14]

!

gcoo!!Exykgvyukhhytocfplanationufvhyg:

3 0
3 years ago
DEFINE WHAT COPYRIGHT?
Reika [66]
Copyright is when someone is given the right to print, publish or make a film.
5 0
3 years ago
Read 2 more answers
What type of bus does PCI use?
Vera_Pavlovna [14]

Answer:

PCI uses a 32-bit or 64-bit parallel bus.

8 0
2 years ago
What's wrong with SontungMTP's song?
Anettt [7]

Answer:

A

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • Assume that the 100,000 element integer array that you allocated starts at address 0x50000000 in memory, the size of an integer
    6·1 answer
  • What component of effective feedback is demonstrated by giving examples of what an employee is doing right instead of just prais
    14·2 answers
  • How many points are in an inch? <br> A 24<br> B 50<br> C 72<br> D 100
    5·1 answer
  • Quinton is having trouble learning Spanish because he keeps reverting back to the grammatical structures of his native English l
    6·1 answer
  • Callie Crystal owns and operates one of the most successful local coffee shops in Denver, called The Edgewater Café. Each time a
    5·2 answers
  • Which is NOT a benefit of using visual aids?
    9·2 answers
  • What is the turns ratio of the transformer T10261
    5·1 answer
  • What color mode would you use when designing for web &amp; devices?
    9·1 answer
  • Visit on social networking site and look for the site's privacy policy.The link is typically found at the bottom of the page and
    9·1 answer
  • How can we avoid falling victim to a phishing or pharming scheme
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!