Alright I'm currently in a C++ class and we just got to switch statements, and I can't get them to work for the life of me. I've googled my issue and my code seems to be exactly right, but no matter what my code doesn't work correctly, so I guess it isn't right.
For this program we need to ask a person if they are a member of a club. If they are a member, ask them their age, depending on the age charge them the right amount. If they aren't a member, charge them something else.
Attempted it multiple times with different code, but I'm stuck now. As far as I'm aware this is exactly what the book shows for code, so no idea why it isn't working. Here's my current code, hopefully you guys can explain to me what is wrong!
#include <iostream>
using namespace std;
int main()
{
char membership = ' ';
int age = 0;
int fee = 0;
membership = toupper(membership);
cout << "Are you an existing member? (M or N) " ;
cin >> membership;
switch (membership)
{
case 'M':
cout << "Current Age? ";
cin >> age;
if (age >= 65)
{
fee = 5;
}
else if (age <= 64)
{
fee = 10;
}
case 'N':
fee = 20;
}
cout << "Seminar fee is: $" << fee << endl;
system("pause");
}