Question: PURPOSE The purpose of this assignment is to write basic C programs using selection control, repetitions, functions and files for a given problem (CLO2) and

PURPOSE

The purpose of this assignment is to write basic C programs using selection control, repetitions, functions and files for a given problem (CLO2) and demonstrate the implementation of appropriate programming features with suitable test data and output. (CLO3)

REQUIREMENT

You are required to develop a program for Wise Health Club Membership to register new members and calculate their membership fees. The program requires user to input name and age of the member, and then determine the members category (Adult or Senior Citizen) based on their age. Anyone under 19 years old is not allowed to join as members. The program also requires input the duration of membership in months. A member can pay in installments if the membership duration is more than 12 months. If the membership duration 12 months or less, then the number of installments is 0.

Create functions 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. The monthly installment information is to be stored on a file together with the members name and category. Table 1 shows the rate of the respective members category.

Table 1 Rate per month for Membership

Age

Members category

Rate (RM) per month

19 to 59

Adult

50

60 and above

Senior Citizen

20

The sample input and output of the program is displayed as follows:

Wise Health Club Membership Menu

  1. Membership application
  2. Membership fees
  3. Exit

Enter your choice: 1

Hello, welcome to Wise Health Club

Enter your name: Fahmei

Enter your age: 30

You are categorized as Adult member.

Enter your choice: 2

Enter duration of membership: 12

Enter number of installment months: 0

The total fees are RM 600

You are not allowed to pay in installments.

Wise Health Club Membership Menu

  1. Membership application
  2. Membership fees
  3. Exit

Enter your choice: 1

Hello, Welcome to Wise Health Club

Enter your name: Saiful

Enter your age: 65

You are categorized as Senior member.

Enter your choice: 2

Enter duration of membership: 25

Enter number of installment months: 10

The total fees are RM 500

Month Installment Balance

1 50 450

2 50 400

3 50 350

4 50 300

5 50 250

6 50 200

7 50 150

8 50 100

9 50 50

10 50 0

Wise Health Club Membership Menu

  1. Membership application
  2. Membership fees
  3. Exit

Enter your choice: 3

Good bye.

The assessment will be done based on the following criteria:

  1. A proper writing of C codes: structure, efficiency and modular.
  2. The readability, consistency, naming and user interface
  3. Robustness and testing
  4. Complete documentation and correct submission.

Note: You MUST write C programming codes for this assignment. Codes written in C++ will not be accepted.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!