Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help writing this code UUM Sport Center provides sport facilities to its customers who are either students, staff or non-UUM (outsiders). The types

I need help writing this code

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed
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 houriy charges are based on the customer categories as shown below: Type of Facility I Badminton Squash 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... - X UUM Sport Center Charg. O X Facility Type: Category. Facility Type: Category: Squash Student Badminton Student O Staff Staff Non-UUM Non-UUM Num Of Hours: 2 Num Of Hours: 1 Calculate Charge Calculate Charge Category: Student Category: Staff Facility Type: Squash Facility Type: Badminton Number of hours: 2 Number of hours: 1 Charge: 0.0 Charge: 4.0 UUM Sport Center Charg.. X UUM Sport Center Charg.. X Facility Type: Category: Facility Type: Category: Squash O Student Sauna Student O Staff O Staff Num Of Hours: 2 Non-UUM Num Of Hours: 1 Non-UUM Calculate Charge Calculate Charge Category. NonUUM Category: Student Facility Type: Squash Facility Type: Sauna Number of hours: 2 Number of hours: 1 Charge: 12.0 Charge: 3.0UUM Sport Center Charg. X UUM Sport Center Charg.. O X Facility Type: Category. Facility Type: Category. Sauna Student eunes Student O Stan O Stan Num Of Hours: 2 Non-UUM Num Of Hours: 2 Non-UUM Calculate Charge Calculate Charge Category. Staff Facility Type: Sauna Category: NonUUM Facility Type: Sauna Number of hours: 2 Number of hours: 2 Charge: 10.0 Charge: 20.0 This program uses two classes, SportChargeCalculatorUI and Customer, as shown in the UML class diagrams below: Customer SportChargeCalculatorUI category : String facType : String //GUI components not shown here hours : int + SportChargeCalculatorUI () + Customer(String category, String facType, - calcBTNActionPerformed(): void int hours) + calculateCharge(): double The SportChargeCalculatorUI class has GUI components whose names are shown as below: UUM Sport Center Charg. - O X Facility Type: Category. studentRB typeCB Badminton Student O Staff staffRB hoursTF nonUUMRB Num Of Hours: 2 Non-UUM Calculate Charge calcBTN Category: Student Facility Type: Badminton outputTA Number of hours: 2 Charge: 0.0When 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 SportChargeCalculatorUI classes. NOTE: The files that must be submitted in your compressed file are Customer.java, SportChargeCalculatorUI.java and SportChargeCalculatorUl.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 calculateCharge () method

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions

Question

What forces have led to the boom in entrepreneurship in the United?

Answered: 1 week ago