#include <iostream>
using namespace std;
int main(void)
{
int age; int weight; char smoker;
cout << "Want to become an astronaut? \n";
cout << "What is your age \n";
cin >> age;
cout << "What is your weight (kg)? \n";
cin >> weight;
cout << "Are you a smoker? (enter y if yes and n if no) \n";
cin >> smoker;
if ((age >= 35 && age <= 46) && (weight >= 50 && weight <= 80) && ( smoker == y ))
cout << "We may consider.";
else
cout << "Sorry we cannot accept you as an astronaut.";
return 0;
}
Last edited on
In order to be able to use the function toupper() remember to include <stdio.h>
Thx a lot... It works. I'm kinda new in programming, so this kind of small error may be made