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
PIT_PIT [208]
3 years ago
12

Write c++ program bmi.cpp that asks the user bmi.cpp the weight (in kilograms) and height (in meters).

Computers and Technology
1 answer:
Galina-37 [17]3 years ago
8 0

Answer:

// here is code in C++(bmi.cpp).

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

   // variables

float weight,height;

cout<<"enter the weight(in kilograms):";

//read the weight

cin>>weight;

cout<<"enter the height(in meters):";

//read the height

cin>>height;

// calculate the bmi

float bmi=weight/(pow(height,2));

// print the body-mass index with two decimal places

cout<<"BMI is: "<<fixed<<setprecision(2)<<bmi<<endl;

return 0;

}

Explanation:

Read the weight from user and assign it to variable "weight",read height and assign it to variable "height".Then find the body-mass index as (weight/height^2).Here weight  should be in kilograms and height should be in meters.

Output:

enter the weight(in kilograms):75

enter the height(in meters):1.8

BMI is: 23.15

You might be interested in
Several people work with data at Erica’s office. She enters data. One of her coworkers enters new product numbers. Another cowor
Dvinal [7]

Answer:

a software program for storing, managing, and retrieving information

Explanation:

8 0
3 years ago
Robin has four copies of her midterm paper saved to a single folder on her
podryga [215]

Answer:

d

Explanation:

i took the test

6 0
3 years ago
D. The 7-bit ASCII code for the character '&amp;' is:
insens350 [35]

Answer:

00100110

a and d are invalid sequences because they contain an even number of 1's.

Explanation:

Odd parity means that you want an odd number of 1's in the resulting set of bits. Since there are 3 (=odd) bits in the set, a zero must be added to keep the total odd.

6 0
4 years ago
_____ is a scam in which access to one's own computer is locked or restricted in some way.
gtnhenbr [62]
Ransomware is the answer to this.
5 0
3 years ago
write a function that returns a list, where each member of list contains previous day’s value multiplied by 2.​
sergeinik [125]

Answer:

Explanation:

The following code is written in Java, the function takes in a list with the previous day's values. The function then uses that list, loops through it and multiplies each individual value by 2 and returns the modified list. The first red  square represents the test case for the function, while the second red square in the image represents the output.

 public static ArrayList<Integer> doubleIt(ArrayList<Integer> mylist) {

       for (int x = 0; x<mylist.size(); x++) {

           mylist.set(x, mylist.get(x)*2);

       }

       return mylist;

   }

5 0
3 years ago
Other questions:
  • Page _____ refers to whether a page is laid out vertically or horizontally.
    12·1 answer
  • "Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B, Y) and the user must repeat the sequen
    10·1 answer
  • What does NVRAM stand for
    8·2 answers
  • This inventor made their own fortune. They had little to no help in become one of the first black millionaires. They invented a
    9·1 answer
  • What is an entity? An attribute?
    13·1 answer
  • True or False: <br> The object reference can be used to polymorphically store any class in Java.
    13·1 answer
  • In order to convert your project to a mobile platform, you need to do all of the following except:
    14·1 answer
  • What does RoHS stand for and why is RoHS compliance important?
    9·1 answer
  • your own choice Identify an organisation of whether factual of fiction with the following Consideration:The three best os to int
    14·1 answer
  • How do i copy a canvas course from old class to new course.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!