Created
February 9, 2018 15:02
-
-
Save hsandid/144a823367eae7de0288dfc89e94fbdb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
using namespace std; | |
int main() | |
{ | |
string fname,lname; | |
double yob; | |
double height,weight,age,bmi; | |
cout<<"Please input your first name\n"; | |
cin>>fname; | |
cout<<"Please input your last name\n"; | |
cin>>lname; | |
cout<<"Please input your date of birth\n"; | |
cin>>yob; | |
cout<<"Please input your height in meters\n"; | |
cin>>height; | |
cout<<"Please input your weight in KG\n"; | |
cin>>weight; | |
age = 2018-yob; | |
bmi = weight/(height*height); | |
cout<<"Dear "<<lname<<" "<<fname<<", your age is "<<age<<" and your BMI is "<<bmi<<endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment