Question: Exercise 5 10 pointsl: You are asked to write a discount system for a beauty saloon, which provides services and sells beauty products. It offers

 Exercise 5 10 pointsl: You are asked to write a discount

Exercise 5 10 pointsl: You are asked to write a discount system for a beauty saloon, which provides services and sells beauty products. It offers 3 types of memberships: Premium, Gold and Silver. Premium, gold and silver members receive a discount of 20%, 15%, and 10%. respectively, for all services provided. Customers without membership receive no discount. All members receives a flat 10% discount on products purchased (this might change in future). Your system shall consist of three classes: Customer, Discount and Visit, as shown in the class diagram. It shall compute the total bill if a customer purchases $x of products and Sy of services, for a visit. Also write a test program to exercise all the classes Customer Visit mcustomer: Customer name:String -member:boolean-false -memberType:String -date:Date -serviceExpense:double productExpense :double +Customer (name: String) +getName():String +isMember):boolean +setMember(member:boolean):void +getMemberType():String +setMemberType(type:String):void +toString ):String +Visit(name:String,date:Date) +getName():String +getServiceExpense(): double +setServiceExpense (ex:double) :void +getProductExpense(): double +setProductExpense(ex:double):void +getTotalExpense () :double +toString ():String DiscountRate -serviceDiscountPremium: double-0.2 -serviceDiscountGold: double-0.15 -serviceDiscountSilver:double-0.1 roductDiscountPremium: double-0.1 -productDiscountGold: double-0.1 roductDiscountSilver:double-0.1 +getServiceDiscountRate(t +getProductDiscountRate(t String):double :String): double The class DiscountRate contains only static variables and methods (underlined in the class diagram) Save your test class in BeautySaloon.java file. Exercise 5 10 pointsl: You are asked to write a discount system for a beauty saloon, which provides services and sells beauty products. It offers 3 types of memberships: Premium, Gold and Silver. Premium, gold and silver members receive a discount of 20%, 15%, and 10%. respectively, for all services provided. Customers without membership receive no discount. All members receives a flat 10% discount on products purchased (this might change in future). Your system shall consist of three classes: Customer, Discount and Visit, as shown in the class diagram. It shall compute the total bill if a customer purchases $x of products and Sy of services, for a visit. Also write a test program to exercise all the classes Customer Visit mcustomer: Customer name:String -member:boolean-false -memberType:String -date:Date -serviceExpense:double productExpense :double +Customer (name: String) +getName():String +isMember):boolean +setMember(member:boolean):void +getMemberType():String +setMemberType(type:String):void +toString ):String +Visit(name:String,date:Date) +getName():String +getServiceExpense(): double +setServiceExpense (ex:double) :void +getProductExpense(): double +setProductExpense(ex:double):void +getTotalExpense () :double +toString ():String DiscountRate -serviceDiscountPremium: double-0.2 -serviceDiscountGold: double-0.15 -serviceDiscountSilver:double-0.1 roductDiscountPremium: double-0.1 -productDiscountGold: double-0.1 roductDiscountSilver:double-0.1 +getServiceDiscountRate(t +getProductDiscountRate(t String):double :String): double The class DiscountRate contains only static variables and methods (underlined in the class diagram) Save your test class in BeautySaloon.java file

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!