[Solved] SOLVED:Salon Report

$25

File Name: SOLVED:Salon_Report.zip
File Size: 178.98 KB

SKU: [Solved] SOLVED:Salon Report Category: Tag:
5/5 - (1 vote)

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 15Shampoo 4.00 10Manicure 18.00 30Style 48.00 55Trim 6.00 5Create 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 fields 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.Test your two classes with the driver class provided :public class Tester02{public static void main(String[] args){SalonReport sr = new SalonReport(2);sr.insertService(0, 0, 2);sr.insertService(1, 0, 3);sr.insertService(2, 0, 3);sr.insertService(3, 0, 1);sr.insertService(4, 0, 2);sr.insertService(0, 1, 4);sr.insertService(1, 1, 2);sr.insertService(2, 1, 0);sr.insertService(3, 1, 2);sr.insertService(4, 1, 1);System.out.println(sr.calculateServiceTotalByEmployee(1, 0));/* Should print 12 */System.out.println(sr.calculateServiceTotalByEmployee(4, 1));/* Should print 6 */System.out.println(sr.calculateServiceTotalByEmployee(0, 1));/* Should print 32 */System.out.println(sr.calculateServiceTotal(1));/* Should print 20 */System.out.println(sr.calculateServiceTotal(3));/* Should print 144 */System.out.println(sr.calculateSalonTotal());/* Should print 284 */}}

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] SOLVED:Salon Report
$25