Question: Pay interface +tau double 50 +gotPayment O double Perper name: String toStringle String Invoice - Idi long inData:java.util.Date produs Product (100) - neprint totalPayment: double


Pay interface +tau double 50 +gotPayment O double Perper name: String toStringle String Invoice - Idi long inData:java.util.Date produs Product (100) - neprint totalPayment: double seller Employee + Invoiced Int. InvDate: Datel + accreduct (p: Product sty: int): boalan gelb 0:int + set idi Invold + geti Date D:Date +tNOPlint + cetTotal Payment ( double +getseller D: Employee dler(wer: Employee void toString String Employee position: String #salary: double #bentu: double +toString Oi String + equals for Obiectl boolean Product - name String - price: double color: String - Product (namai String price double) - Product name: String prices doble, color: String) gotame String retilme(name: Strinelivold * Price ( double stPrice (priem: double vaid * Color String - setColor (color: Stringli void -toString Di String www.lang.Comparable Products cinterface campar Tafe: Product 1- Build the interface "Pay" 2- Build the "Product" class 3- Build the concrete class "Invoice" that implements the interface "Pay". Make sure to implement everything mentioned in the above class diagram, and note the following: . . . "invDate" is the date of creating this "Invoice" "prods" is an array of 100 "Product" instances "nop" is an integer to count how many "Product" instances are added into the array "prods" "totalPayment" is the total price of added products "seller" is an instance of "Employee" class "addProduct" is the most important method, it implements the following: It receives a "Product" instance and the integer "qty" Add this "Product" instance to the array if it is not full (check the "nop" counter), and increment the "nop" counter when you succeed to add it If you succeeded to add the "Product" instance into the array. get the price of this "Product" instance and multiply it by the quantity and add this value to the "totalPayment" Add the value 2 to the "bonus" of the "seller" on each "Product instance added Return true when you succeed to add the received "Product" instance and false otherwise Override the "getPayment()" method that is defined in the interface "Pay' so that this class becomes concrete. This method should return the "totalPayment" calculated minus the "tax" that is defined in the "Pay" interface
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
