Please find below the C++ code for the above problem. I have also attached 2 photos. One for the code and other for code and the output.
#include <bits/stdc++.h>
using namespace std;
float calculateBMI(int height_in_inches, int
weight_in_pounds)
{
//calculating BMI
float BMI =
(weight_in_pounds/float(height_in_inches*height_in_inches))*703;
return BMI;
}
int main()
{
string names[9] = {"Ann", "Jen", "Tim", "Tom", "Mike",
"Ben", "Mon", "Bob", "Brad"};
int weights[9] = {120, 152, 133, 222, 175, 150, 181,
162, 188};
int heights[9] = {65, 70, 75, 69, 55, 57, 69, 82,
57};
for(int i=0;i<9;i++)
{
//converting float BMI value to
string
string s1 =
to_string(calculateBMI(heights[i],weights[i]));
// taking substring with 2 decimal
values
s1 = s1.substr(0,5);
//printing output
cout<<names[i]<<",your
BMI is "<<s1<<"."<<endl;
}
}
c++ pls 10D yUur Tugt Sna you will have to re-take it at another time PROBLEM...
IT Java code In Lab 8, we are going to re-write Lab 3 and add code to validate user input. The Body Mass Index (BMI) is a calculation used to categorize whether a person’s weight is at a healthy level for a given height. The formula is as follows: bmi = kilograms / (meters2) where kilograms = person’s weight in kilograms, meters = person’s height in meters BMI is then categorized as follows: Classification BMI Range Underweight Less...
Please solve the following, please type out the code, and do not hand write because its hard to read. I would greatly appreciate it. (JAVA) Problem 1 In a class called H1P1, write a method called bmiOne that takes as arguments a mass in kilograms (a double) and a height in meters (also a double), and returns the body mass index (or BMI) for the given data. If we have mass -m kg and height-h meters, then BMI = Write...
How do you calculate BMI for a L bka? In the problem we have a patient with a Left Below knee amputation and are suppose to calculate BMI for the patient: age:38 height: 69 inches weight: 210 pounds. I calculated BMI and got 31.0081916 but I don't know how to factor in the L bka. Please help thank you
I have this C program that calculates an input and converts it to a BMI calculation. Any idea how this would look as an LC3 program? I'm taking an LC3 programming class next semester and want an idea of what this code would even translate to, just trying to get a head start. I'm more so curious on how to get user input in a LC3 program, then I can try myself and figure it out from there. int main()...
Using C++ cs 102 REVIEW LAB Selection a) Minimum/Maximum: Nrite a program that asks the user to enter two numbers. The progzan should use the conditional operator to determine which number is the smaller and which is the larger. Display your output in the format below: The smaller number is: (smallerNumber) The larger number is: ClargerNumber] b) Areas of Rectangles: The area of a rectangle is calculated by maltiplying its length tines its width. Write a program that asks the...
Please write this code in C++ Object-Oriented Programming, specify which files are .h, and .cpp, and please add comments for the whole code. Include a class diagrams, and explain the approach you used for the project and how you implemented that, briefly in a few sentences. Please note the following: -Names chosen for classes, functions, and variables should effectively convey the purpose and meaning of the named entity. - Code duplication should be avoided by factoring out common code into...
+ Run C Code IMPORTANT: • Run the following code cell to create the input file, biostats.csv, which you will be using later. 74, In [ ]: N %%file biostats.csv Name, Sex, Age, Alex, M, 41, Bert, M, 42, Dave, M, 39, Elly, F, 30, Fran, F, 33, Jake, M, F, Luke, M, 34, F Myra, M, M, 38, Ruth, F, 28, 22 22 323 47 47, Height, Weight 170 200 167 70 115 143 139 280 98 75, 350...
Use only if else nested if else only otherwise your answer won't be entertained. Problem 1(b): Write a program that gives remainder without using modulus operator and loops. The first number entered will be dividend and second number entered will be divisor. Sample input: 15 6 Sample output: Remainder is 3 In a right triangle, the square of the length of one side is equal to the sum of the squares of the length of the other two sides. Write...
3,4, and 5 please! 15 points Answer the following questions. Please show your work to help justify your Show critical thinking skills Narrative. J.R is a 27-year-old male. He is 5 feet, 9 inches tall. He weights 187 pounds. He runs three days a week, a moderate pace, for 20 minutes. On the weekends, he enjoys doing yardwork, walking his dog, and hanging out with his friends. J.R. would like to improve his overall diet, and he has the following...
Project 3 Instructions 1. Due Date & Time: 09-26-2020 at 11:59 PM WHAT TO SUBMIT Submit 1 zip file containing 4 files below to iLearn by the deadline. [30 points] ● 3 JAVA Files: TableBmiPro.java, MyOwnIdea.java. DiceRoll.java [24 points] ● 1 File: Make a document that shows the screen captures of execution of your programs and learning points in Word or PDF. Please make sure you capture at least 2 executions for 1 program, so 6 screen captures and one...