Asked By
jAlbert
140 points
N/A
Posted on - 04/27/2011
Hi
I need to write a program. It’s very much difficult for me to attempt without any help. Please give me an idea solution to understand how can i solve this program?
This is about to write a program that will display the following menu of a health club:
-
Standard Adult Membership
-
Child Membership
-
Senior Citizen Membership
-
Quit the program
The program will take input from the user about the choice selection of above menu and also will take number of months. Then the program will calculate the membership charges for the given number of months as follows:
-
Standard Adult Membership Rs.50
-
Child Membership Rs.20
-
Senior Citizen Membership Rs.30
Please help me Programming GURU Mark Jason, Please I am waiting for your reply
Answered By
Sahil
0 points
N/A
#89076
Need Program Output for a health card menu
Hi
I am giving you the idea solution for this problem. You need to read your books as well as your instructor’s help to fully solve this.
Firstly you need to show the output on the screen “Health Club Membership Menu”.
-
Standard Adult Membership
-
Child Membership
-
Senior Citizen Membership
-
Quit the program
Then you will take the user input for the choice of menu item. Then you will take the input for the number of months. And lastly you will calculate the charges of club membership according to your choice for the given number of months.
That’s it. Hope you will be ok with this. Let me know for more other help.
Answered By
jAlbert
140 points
N/A
#89077
Need Program Output for a health card menu
Thanks a lot Sahil; I am waiting for the idea solution from long time.
Please help me to understand, how the user will select menu item from the menu. Because I found it’s very difficult to match a string in programming. Whether I need to match the string of menu item or I can use any other option that suits best.
Waiting
Answered By
Dev_Raj
160 points
N/A
#89079
Need Program Output for a health card menu
Can any one send the code please???????????
Answered By
Sahil
0 points
N/A
#89080
Need Program Output for a health card menu
The user will select the menu in the form of integers. 1 will represents first option, 2 will second option and so on. And then you can use if else or Switch statement to calculate the charges for the given months by the user.
Answered By
jAlbert
140 points
N/A
#89082
Need Program Output for a health card menu
Thanks a lot Sahil
I am trying your given concepts in compiler. As I got the result, I will send you my code for checking.
Regards
Need Program Output for a health card menu
#include<iostream.h>
#include<iomanip.h>
void main()
{
int choice, months;
Double charges
cout<<”Health Club Membership Menu “<<endl;
cout<<”1. Standard Adult Membership “<<endl;
cout<<”2. Child Membership “<<endl;
cout<<”3. Senior Citizen Membership “<<endl;
cout<<”4. Quit the program “<<endl;
Cout<<” Enter your choice “<<Endl;
Cin>>choice;
If(choice>=1 && choice<=3)
{
cout<<” For how many months “<<endl;
cin>>months;
switch(choice)
{
case1: charges=months*50.0;
break
case2: charges=months*20.0;
break
case3: charges=months*30.0;
break
}
cout<<” The total chares are” <<charges<<endl;
}
else if(choice!=4)
{
cout<<” The valid choices are 1 to 4” <<endl;
cout<<” Run the program again and selects these choices” <<endl;
}
}
Answered By
jAlbert
140 points
N/A
#89085
Need Program Output for a health card menu
Marvelous solution
You are the best Mark Jason
Heartily Thankful to you dear
Stay Blessed and Happy.