Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#include #include using namespace std; int main() { int height = 0, weght = 0; double bmi; string name; // prompt user for their data

#include #include using namespace std;

int main() { int height = 0, weght = 0; double bmi; string name; // prompt user for their data cout << "What is your name? "; cin >> name; cout << "Please enter your height in inches: "; cin >> height; cout << "New enter your weight in pounds (round to a whole number): "; cin >> weight; // calculate the bmi weight *= 703; height *= height; bmi = static_cast(weight) / height; // Output the results cout << name << ", your bmi is: " << bmi << endl; if (bmi < 18.5) cout << "This is considered underweight. "; else if (bmi < 25) cout << "This is a normal weight. "; else if (bmi < 30) cout << "This is considered overweight . "; else cout << "This is considered obese. "; return 0; }

Write a MIPS program that calculates bmi. Use the following C++ code as pseudocode. The variable bmi can be single or double precision.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What are the principles of a database management system?

Answered: 1 week ago

Question

How are members held accountable for serving in the assigned roles?

Answered: 1 week ago