This is the instruction. I must do it this way or i will get a zero tomorrow.
You will create a program that calculates and outputs the BMI for two people.
variables(in the main)
int height1, height2, wieght1, weight2;
double bmi1, bmi2;
double scalar = 703.0;
Functions:
Calculates and returns the bmi based on height h, weight w and scalar s
*HINT* We cannont use ^ to raise things to a power, so think about what squaring means
double getBMI(int h, int w, double s)
Informs the user of a single bmi, b. This function should make use of the <iomanip> features to display the bmi to decimal places.
void output (double b)
all input will be done in main
Here is my code so far
#include <iostream>
#include <iomanip>
using namespace std;
double getBMI (int h, int w, double s)
C:\Users\KILL\Downloads\bmi.cpp||In function 'double getBMI(int, int, double)':|
C:\Users\KILL\Downloads\bmi.cpp|7|error: expected identifier before '(' token|
C:\Users\KILL\Downloads\bmi.cpp|7|error: named return values are no longer supported|
C:\Users\KILL\Downloads\bmi.cpp|11|error: 'b' was not declared in this scope|
C:\Users\KILL\Downloads\bmi.cpp||In function 'int main()':|
C:\Users\KILL\Downloads\bmi.cpp|26|error: 'BMI1' was not declared in this scope|
C:\Users\KILL\Downloads\bmi.cpp|27|error: expected ';' before 'BMI2'|
C:\Users\KILL\Downloads\bmi.cpp|29|error: 'BMI2' was not declared in this scope|
C:\Users\KILL\Downloads\bmi.cpp|29|error: 'output' was not declared in this scope|
C:\Users\KILL\Downloads\bmi.cpp|33|error: expected unqualified-id before 'return'|
||=== Build finished: 8 errors, 0 warnings ===|
*HINT* We cannont use ^ to raise things to a power
Look at the return statement in getBMI()... What are you doing there? Hint, its something you were specifically told not to do. Also, you will need parenthesis around the h*h in the return statement, to get the proper order of operations.