Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #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;
- }
Add Comment
Please, Sign In to add comment