So far I have this but I need to use switch statements to make age< certain numbers for each age group.
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
const float CHILDREN_MALE=50.00;
const float CHILDREN_FEMALE=55.00;
const float TEENAGERS_MALE=150.00;
const float TEENAGERS_FEMALE=155.00;
const float ADULTS_MALE=275.00;
const float ADULTS_FEMALE=250.00;
int main()
{
int Age, name;
float Mcost=0.0;
float total=0.0;
char Gender;
cout << fixed << showpoint << setprecision (2);
//Display Menu
cout << "-------------Fullerton Health Club--------------" << endl;
cout << "Children (Age 1-12) " << endl;
cout << setfill ('.');
cout << left << setw(15) << "\tMale" << right << setw(6) << CHILDREN_MALE << endl;
cout << left << setw(15) << "\tFemale" << right << setw(6) << CHILDREN_FEMALE << endl;
cout << "Teenagers (Age 13-19)" << endl;
cout << left << setw(15) << "\tMale" << right << setw(6) << TEENAGERS_MALE << endl;
cout << left << setw(15) << "\tFemale" << right << setw(6) << TEENAGERS_FEMALE << endl;
cout << "Adults (Age > 19)" << endl;
cout << left << setw(15) << "\tMale" << right << setw(6) << ADULTS_MALE << endl;
cout << left << setw(15) << "\tFemale" << right << setw(6) << ADULTS_FEMALE << endl;
//Ask for age, gender, and full name
cout << "Enter your age? ";
cin >> Age;
cout << "Enter your gender(m/f)? ";
cin >> Gender;
cout << "Enter your full name: ";
cin >> name;
cout << " Hello Mr. " << name << ",";
cout << "
system ("pause");
return 0;
}
Has to have 3 different outputs like this with different ages:
Enter your age? 48
Enter your gender(m/f)? m
Enter your full name: Barack H Obama
Hello Mr. Barack H Obama
Your membership fee is 302.50
Enter your age? 18
Enter your gender(m/f)? f
Enter your full name: Hilary Clinton
Hello Mrs. Hilary Clinton
Your membership fee is 165.50