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
Given the following snippet of code, answer the following two questions based on the code: typedef enum {Sun, Mon, Tue, Wed, Thu
ANEK [815]

Answer:

1) The value of x will be 6.

2) The value of y will be 7.

Explanation:

1) The value of x will be 6.  

The enum values are labeled by default from 1. This means that Sun = 1, Mon = 2, Tue = 3 and so on.  

So, x = Mon = 2 and y = Sat = 6  

x increases up to y = 6 in the while loop.  

and then y also increments by 1.  

2)So the value of y = 7.  

You will need actual printf("Sun") or printf("Mon") for printing the actual text for the enum.

7 0
3 years ago
Rapid va rog!!!!!!! Am 30 minute la dispozitie!! PLSSS !!!!!
Stella [2.4K]

uhhk if r dB BBL I 6th cnn he'll of

8 0
3 years ago
If a= ‘ Stay home, Stay safe’ , print its value
Damm [24]

Answer:

Since the language isn’t stated, I’ll give answers in the two most-used (?) languages: Java and Python.

a) To print a’s value 3 times in the same line, in Java we would do:

System.out.print(a+a+a);

In Python, we would write:

print(a*3)

b) 2 times in different lines using one print statement

In Java, we would write

System.out.println(a+”\n”+a+”\n”+a);

In Python we would write:

print(a,a,a,sep=’/n’)

Hope this helps!

7 0
2 years ago
Plzz help will mark brainliest
vlabodo [156]

Answer:

11. 3 dimensions

12. ( i believe its number 3)

13. 2 option

14. Natural Light

15. Development

Explanation:

7 0
3 years ago
The physical parts or components of a computer system is called .
dmitriy555 [2]
Answer:
Motherboard

Explanation:
Motherboard is the main component of a computer. It connects with other parts of the computer including drive disks, RAM and CPU and any other expansion slots :)

(Hope it helped)
4 0
3 years ago
Other questions:
  • 7 features of QBASIC
    6·1 answer
  • ) The ________ displays a text box and button for users to browse, select, and upload a file. (Points : 3)
    13·1 answer
  • Which of the following is a characteristic of the internet today? distributed network central hub lack of protocols absence of c
    5·1 answer
  • What menu allows you to look up a command and learn how to use it?
    14·1 answer
  • In this question, you must create a function in C++ using an external editor. When satisfied with your work, you shall attach it
    10·1 answer
  • Which of the following is an example of hypertext pattern reading?
    13·1 answer
  • What safety feature melts to protect a circuit? a. fuse b. diode c. three-prong plug d. transistor
    10·2 answers
  • The CSS property of top , bottom , left , or right moves the element the specified distance from the respective edge of the clos
    7·1 answer
  • Why is the yellow light blinking on the front of my computer
    10·1 answer
  • I need major help. Word processing
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!