QUESTION Five 7Two Fitness Centre provides facilities such as aerobic and strength training equipment to members of the
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
QUESTION Five 7Two Fitness Centre provides facilities such as aerobic and strength training equipment to members of the
QUESTION Five 7Two Fitness Centre provides facilities such as aerobic and strength training equipment to members of the public. It opens daily from 10 am to 10 pm. The centre charges its customers based on the duration (number of hours) each customer uses its facilities daily. These charges however, varies depending on the customer's type (member or non-member) and the type of the day (weekdays or weekends). The table below shows the hourly rate based on the customer and day types: Weekday Weekend Member RM3.00 RM4.00 Non-Member RM5.00 RM6.00 Based on above scenario: Write a Java program that accepts customer's information including name, customer's type, duration (between 1 to 12 hours only), type of the day and date, and then displays the total charge for customer. You are required to create 2 classes named Customer and TestCustomer. Declare appropriate data members for the class Customer and include the following methods as well: ▪ Constructor - to initialize name, name, customer's type, duration and type of the day and date values that are received through the parameters of the method. ▪ calculateCharge() - calculates the total charges ▪ displayCharge() - displays the output similar as shown below Customer Name: Ali Customer Type: Member Duration: 3 hours Type of the day: Weekend Date: 22 June 2022 Total Charge: RM 12.00 • The class TestCustomer will contain the main method that consists of the statements to read the user input and invoke the methods of the class Customer.