Write a complete C++ program that will prompt name, gender (M or F), age (in years) and marital status (single or married) for each student in FISE and calculate the numbers of married men, single men, married women and single women. Printthese numbers on a student summary report. If any single men are over 30 years of age, print their names and ages on a separate eligible bachelor’s report.
Here is program:
int main()
{
string name;
int gender;
int age;
int maritalstat;
cout << "Enter name: " << endl;
cin >> name;
cout << "Enter gender: " << endl;
cout << "1) Male" << endl;
cout << "2) Female" << endl;
cin >> gender;
cout << "Enter age(in years):" << endl;
cin >> age;
cout << "Enter marital status: " << endl;
cout << "1) Single" << endl;
cout << "2) Married" << endl;
cin >> maritalstat;
}
Comments
Leave a comment