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
What is the answer to this binary?
USPshnik [31]
Relating to, using, or expressed in a system of numerical notation that has 2 rather than 10 as a base.
5 0
3 years ago
A soft drink company recently surveyed 12,467 of its customers and found that approximately 14 percent of those surveyed purchas
Mnenie [13.5K]

Given Information:

Total number of customers = 12,467

Customers who purchase one or more energy drinks per week = 14%

Customers who prefer citrus flavored energy drinks = 64% of customers who purchase one or more energy drinks per week

Required Information:

1. the approximate number of customers in the survey who purchase one or more energy drinks per week

2. the approximate number of customers in the survey who prefer citrus flavored energy drinks

Code with Explanation:

#include <iostream>

using namespace std;

int main()

{

   int customers = 12467;  // total no. of customers given

   int buy_drink;  // to store the number of customers who buy one or more energy drinks per week

   int citrus_drink;  // to store the number of customers who prefer citrus flavored energy drinks

 

   buy_drink = customers*0.14;  // multiply total number of customers with the % of customers who buy energy drinks

   citrus_drink = buy_drink*0.64;  // multiply no. of customers who buy one or more energy drinks per week with % of customers who prefer citrus flavor

// display the results calculated above

   cout<<"Total number of customers: "<<customers<<endl;

   cout<<"Number of customers who buy one or more drinks per week: "<<buy_drink<<endl;

   cout<<"Number of customers who prefer citrus flavored drinks per week: "<<citrus_drink<<endl;

   return 0;

}

Output:

Total number of customers: 12467

Number of customers who buy one or more drinks per week: 1745

Number of customers who prefer citrus flavored drinks per week: 1116

7 0
3 years ago
Which laptop part is usually replaceable through unlocking it, pulling it out, and then replacing it with a new one?
leva [86]

Answer:

maccbook

Explanation:

maccbooks r awesome

7 0
3 years ago
Read 2 more answers
Random-access memory (RAM) is able to quickly access data because it is arranged in which of the following configurations?
lianna [129]

Answer:

A two-dimensional grid consisting of rows and columns of memory cells

Explanation:

Radom access memory is made of bits of data or program code that are tactically arranged in a two-dimensional grid. DRAM will store bits of data in what's called a storage, or memory cell, consisting of a capacitor and a transistor. The storage cells are typically organized in a rectangular configuration.

7 0
2 years ago
Based on the naming recommendations in the book, which of the following is a good identifier for a variable that will be used to
Mazyrski [523]

Answer:

A good identifier for a variable that will be used to hold an employee’s phone number is:

a. EmployeePhoneNumber

Explanation:

An identifier is a string that uniquely identifies or names the entity or an object.  The object or entity may be a constant, variable, structure, function, etc. Identifiers can be formed from uppercase and lowercase letters, digits, and underscores.  Meaningful identifiers mostly favor the use of long descriptive names like EmployeePhoneNumber.  However, the other options can still be used.

7 0
2 years ago
Other questions:
  • A Uniform Resource Locator (URL) is a formatted string of text that web browsers, email applications, and other software program
    15·2 answers
  • Which detail should be included in a summary about the passage check all that apply in warm rivers play role in arctic sea ice m
    9·1 answer
  • A batholith is an example of a(n) _____ igneous rock (one of the two main igneous rock groups).
    9·2 answers
  • Out of the following, find those identifiers, which cannot be used for naming Variables, Constants or Functions in a python prog
    11·1 answer
  • Consider Ron’s budget. How much money does Ron have left over each month?
    9·2 answers
  • If a printer is not Wi-Fi capable, how can it be set up to provide the most reliable wireless printing
    7·2 answers
  • Match the elements of a web page with their descriptions.
    12·1 answer
  • Which of the following statements about wide area networks are true? Select 3 options.
    11·1 answer
  • What is the difference between MySQL and MariaDB?
    9·1 answer
  • “Click” is a type of user input the onEvent code checks for in order to perform actions like going to another screen. List at le
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!