Question: Please use Java: Cash Register simulation In this programming challenge, you will simulate a cash register. The client program will work like this: You will

Please use Java:

Please use Java: Cash Register simulation In this programming challenge, you willsimulate a cash register. The client program will work like this: You

Cash Register simulation In this programming challenge, you will simulate a cash register. The client program will work like this: You will use an array or ArrayList to simulate a shopping cart. You will add Retail!tem objects to your shopping cart. The CashRegister class will process the Retail Items in your cart Create a sales receipt that is an itemization of all the items in your shopping cart and a total cost for all items properly formatted. Use the following UML diagrams to create the class objects, Retailltem and CashRegister. The classes should have appropriate constructor(s), accessor, and mutator methods A Retailltem holds the data about an item in a retail store. The class should have the following fields: description: The description field references a String object that holds a brief description of the item price: The price field is a double that holds the item's retail price numOfpurchase . The numOfpurchase field is an int that holds the quantity of items in cart RetailItem - description : String - price: double - numofpurchase: int +RetailItem (d String, p : double, n : int) +setDescription (d string): void +setPrice (p: double): void +setNumOfPurchase (n : int) : void +get Description () : String +get Price() double +getNumOfPurchase() : int A CashRegister object will process each Retailltem to determine cost of item with tax. It will simulate the sale of a retail item. It should have a constructor that accepts a Retailltem object as an argument. In addition, the class should have the following instance variables and methods: retailPrice : The retai!Price field will store the price of the RetailItem being passed to constructor. quantity. The quantity field will store the quantity of the current Retail!tem in your cart. The SubTotal method should return the subtotal of the sale, which is the quantity multiplied by the retail price

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!