Question: UUM Sport Center provides sport facilities to its customers who are either students, staff or non-UUM (outsiders). The types of facilities provided and their




UUM Sport Center provides sport facilities to its customers who are either students, staff or non-UUM (outsiders). The types of facilities provided and their hourly charges are based on the customer categories as shown below: Charge Per Hour (RM) Type of Facility Badminton Student Staff Non-UUM Free 4.00 8.00 Squash Free 1.00 6.00 Sauna 3.00 5.00 10.00 The sport center wants you to write a program that can be used by its staff to calculate the charge to be paid by its customers. Six sample running of the program's GUI are shown below: UUM Sport Center Charg... Facility Type: Squash Num Of Hours: 2 Calculate Charge Category: Student Facility Type: Squash Number of hours: 2 Charge: 0.0 UUM Sport Center Charg... Facility Type: Squash Num Of Hours: 2 Calculate Charge Category: NonUUM Facility Type: Squash Number of hours: 2 Charge: 12.0 UUM Sport Center Charg... Category: Facility Type: Student Badminton Staff Non-UUM Num Of Hours: 1 Calculate Charge Category: Staff Facility Type: Badminton Number of hours: 1 Charge: 4.0 UUM Sport Center Charg... Category: Student Facility Type: Sauna Staff Non-UUM Num Of Hours: 1 Calculate Charge Category: Student Facility Type: Sauna Number of hours: 1 Charge: 3.0 Category: Student Staff Non-UUM Category: Student Staff Non-UUM UUM Sport Center Charg.... Facility Type: Sauna Num Of Hours: Calculate Charge Category: Staff Facility Type: Sauna UUM Sport Center Charg... Category: Student Staff Facility Type: Sauna Non-UUM Num Of Hours: 2 Calculate Charge Category: NonUUM Facility Type: Sauna Category: Student Staff Non-UUM Number of hours: 2 Charge: 10.0 Number of hours: 2 Charge: 20.0 This program uses two classes, SportChargeCalculator UI and Customer, as shown in the UML class diagrams below: Customer SportChargeCalculatorUI //GUI components not shown here + SportChargeCalculatorUI() -calcBTNActionPerformed(): void category: String - facType: String hours: int + Customer(String category, String facType, int hours) + calculateCharge(): double The SportCharge CalculatorUI class has GUI components whose names are shown as below: UUM Sport Center Charg... Facility Type: typeCB Badminton hoursTF Num Of Hours: 2 Calculate Charge Category: Student Facility Type: Badminton Number of hours: 2 Charge: 0.0 Category: studentRB Student staffRB Staff nonUUMRB Non-UUM calcBTN outputTA When the calcBTN button is clicked, the handler method calcBTNActionPerformed () will read the three input data (facility type, category and hours), create an object of the Customer class by passing these three data as parameters to the constructor, calculate the charge by calling the calculateCharge () method and display the output containing the customer category, the facility used, the number of hours and the calculated charge in the text area (named outputTA). Based on the provided information above, write the UUM sport center charge calculator program by defining the Customer and SportChargeCalculatorul classes. NOTE: The files that must be submitted in your compressed file are Customer.java, SportChargeCalculatorUI.java and SportCharge CalculatorUI.form. The incomplete definition of the Customer class is given to you as shown below: Customer.java public class Customer ( private String category; //Customer category private String facType; //type of facility used private int hours; // number of hours used //define the constructor: //define the calculate Charge () method:
Step by Step Solution
3.55 Rating (155 Votes )
There are 3 Steps involved in it
JAVA Program import javautilScanner public class Main public static void mainString args Scanner s... View full answer
Get step-by-step solutions from verified subject matter experts
