In: Computer Science
(Use C++ language) The Bunker Hill Health Club would like you to create a program where users can sign up for memberships. They have three types: Single Membership ($200/year), Family Membership ($350/year), and Membership Plus ($450/year). Your program should display a menu of the membership types and a fourth choice labeled 'Quit', if they don't want to join. Use a Switch-Case decision structure where a message would be displayed stating the membership type they chose and the yearly cost. A default message of 'Invalid choice' should appear if they don't enter a valid entry.
#include<iostream>
using namespace std;
int main()
{
int choice;//variable used to store the selected choice
cout<<"Menu"<<"\n"<<"1. Single Membership-$200/Year"<<"\n"<<"2. Family Membership-$350/Year"<<"\n"<<"3.Membership Plus-$450/Year"<<"\n"<<"4.Quit, if you don't want to join."<<endl;
cout<<"Enter your choice to sign up for membership "<<endl;//Displays menu and its options
cin>>choice;//read the entered choice
switch(choice)
{
case 1: cout<<"You have chosen Single Membership and yearly cost is $200";// if choice is "1" then it will be printed
break;
case 2: cout<<"You have chosen Family Membership and yearly cost is $350";// if choice is "2" then it will be printed
break;
case 3: cout<<"You have chosen Membership Plus and yearly cost is $450";// if choice is "3" then it will be printed
break;
case 4: cout<<"You are successfully quit from the window";// if choice is "4" then it will be printed
break;
default: cout<<"You entered invalid choice";// if the choice is other than 1,2,3,4 it is printed
}
return 0;
}
OUTPUT:shown for every case
Please comment if you have any doubts.
Rtae please!!!!!