You are required to design a program for Health Club Membership. The program requires user to input the members category (Adult or Senior Citizen), duration of the membership and number of installment months. The user can get 20% discount if duration of the membership is equal to 24 months or more, and monthly installment is allowed if the duration of membership is at least 12 months. This program must be able to calculate and display total of the fees and monthly installment. The input process must be repeated until user choose to exit from the program. Table 1 shows the rate of the respective members category.
Table 1 – Rate per month for Membership
Members category | Rate (RM) per month |
Adult | 50 |
Senior Citizen | 20 |
The sample input and output of the program is displayed as follow:
Health Club Membership Menu
- Adult Membership
- Senior Citizen Membership
- Exit
Enter your choice: 1
Enter duration of membership: 12
Enter number of installment months: 6
The total fees are RM 600
Month Installment Balance
1 100 500
2 100 400
3 100 300
4 100 200
5 100 100
6 100 0
Health Club Membership Menu
- Adult Membership
- Senior Citizen Membership
- Exit
Enter your choice: 2
Enter duration of membership: 26
Enter number of installment months: 4
The total fees are RM 416
Month Installment Balance
1 104 312
2 104 208
3 104 104
4 104 0
Health Club Membership Menu
- Adult Membership
- Senior Citizen Membership
- Exit
Enter your choice: 3
Good bye.
Based on the above programming problem:
- Analyse the problem to identify required items to be used in designing algorithm
- Write an algorithm in a pseudo code
- Draw a flowchart based on the pseudo code
- Produce a tracing table to show the projected values