The following table shows the various services offered by a hair salon, including its prices and times required:
Service Description Price ($) Time (Minutes)
Cut 8.00 15
Shampoo 4.00 10
Manicure 18.00 30
Style 48.00 55
Trim 6.00 5
Create a class that holds the service description, price, and number of minutes it takes to perform the service. Include a constructor that requires arguments for all three data fields and three get methods that each return one of the data field’s values. Save the class as Service.
Create a second class called SalonReport which has three attributes:
• A single-dimensional array that can hold five Service objects. Fill the array with the data from the table above.
• Number of employees
• A two dimensional array that will hold the number of each type of service each employee in the salon has conducted.
SalonReport should have the following methods:
• A constructor which takes the number of employees as a parameter
• InsertService(int serviceNo, int employeeNo, int total) – the insert service method will take in the number of times a service was conducted for a particular service and employee. You can assume the numbers passed in for the service and employee are valid indexes for the 2D array.
• calculateServiceTotalByEmployee(int serviceNo, int employeeNo) – returns the total amount earned for a particular employee and particular service. Like the last method, you can assume the numbers passed in are the index of the service and employee.
• calculateServiceTotal(int serviceNo) – returns the total amount earned for a particular service for all employees. (Assume serviceNo is a valid index to the array).
• calculateSalontTotal() – returns the total amount earned for all services for all employees.
Service Description Price ($) Time (Minutes)
Cut 8.00 15
Shampoo 4.00 10
Manicure 18.00 30
Style 48.00 55
Trim 6.00 5
Create a class that holds the service description, price, and number of minutes it takes to perform the service. Include a constructor that requires arguments for all three data fields and three get methods that each return one of the data field’s values. Save the class as Service.
Create a second class called SalonReport which has three attributes:
• A single-dimensional array that can hold five Service objects. Fill the array with the data from the table above.
• Number of employees
• A two dimensional array that will hold the number of each type of service each employee in the salon has conducted.
SalonReport should have the following methods:
• A constructor which takes the number of employees as a parameter
• InsertService(int serviceNo, int employeeNo, int total) – the insert service method will take in the number of times a service was conducted for a particular service and employee. You can assume the numbers passed in for the service and employee are valid indexes for the 2D array.
• calculateServiceTotalByEmployee(int serviceNo, int employeeNo) – returns the total amount earned for a particular employee and particular service. Like the last method, you can assume the numbers passed in are the index of the service and employee.
• calculateServiceTotal(int serviceNo) – returns the total amount earned for a particular service for all employees. (Assume serviceNo is a valid index to the array).
• calculateSalontTotal() – returns the total amount earned for all services for all employees.