123456789101112131415161718192021222324252627282930313233343536373839
cout << "Please enter your high(cm)" ; cin >> height; cout << " 1.convert KG into IN 2.convert IN into KG " ;//unfinish cin >> ope; cout << "Please enter your weight : " ; if (ope == 2) { //input goal cin >> weightlb; weightkg = weightlb / (2.2); cout << "Your weight is "; cout.setf(ios::fixed|ios::showpoint); cout << setprecision(2); cout << weightkg << "(kg)" << endl; } else (ope == 1) { cin >> weightkg; weightlb = weightkg*(2.2); cout << "Your weight is "; cout.setf(ios::fixed|ios::showpoint); cout << setprecision(2); cout << weightlb << "(lb)" << endl; } //calculation double bmi = weightkg / pow(height, 2); double goal = weightlb - 107.8; //output //formatting output cout << "Your BMI is " << bmi << endl; cout << "You still have to loss " << goal << endl;
else if(ope == 1)