Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2006 Edbt 2006 Workshops Phd Datax Iidb Iiha Icsnw Qlqp Pim Parma And Reactivity On The Web Munich Germany March 2006 Revised Selected Papers Lncs 4254

Authors: Torsten Grust ,Hagen Hopfner ,Arantza Illarramendi ,Stefan Jablonski ,Marco Mesiti ,Sascha Muller ,Paula-Lavinia Patranjan ,Kai-Uwe Sattler ,Myra Spiliopoulou ,Jef Wijsen

2006th Edition

3540467882, 978-3540467885

More Books

Students also viewed these Databases questions

Question

Write a Python program to check an input number is prime or not.

Answered: 1 week ago

Question

Be familiar with the five basic ways to manage demand.

Answered: 1 week ago