Course Hero Logo
Question
Answered step-by-step

I am stuck with this problem. Part 1 - RetailItem Class class named...

I am stuck with this problem.

Part 1 - RetailItem Class class named RetailItem that holds 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.  unitsOnHand - The unitsOnHand field is an int variable that holds the number of units currently in inventory.  Price - The price field is a double that holds the item's retail price. constructor that accepts arguments for each field, appropriate mutator methods that store values in these fields, and accessor methods that return the values in these fields. Once you have written the class, separate program that creates three RetailItem objects and stores the following data in them: Description Units on Hand Price Item #1 Jacket 12 59.95 Item #2 Designer Jeans 40 34.95 Item #3 Shirt 20 24.95


Part 2- CashRegister Class CashRegister class that can be used with the RetailItem class that you wrote Part A. The CashRegister class should simulate the sale of a retail item. It should have a constructor that accepts a RetailItem object as an argument. The constructor should also accept an integer that represents the quantity of items being purchased. In addition, the class should have the following methods: 

  • The getSubtotal method should return the subtotal of the sale, which is the quantity multiplied by the price. This method must get the price from the RetailItem object that was passed as an argument to the constructor. 
  • The getTax method should return the amount of sales tax on the purchase. The sales tax rate is 6 percent of a retail sale. 
  • The getTotal method should return the total of the sale, which is the subtotal plus the sales tax.

Demonstrate the class in a program that asks the user for the quantity of items being purchased, and then displays the sale's subtotal, amount of sales tax, and total. 

Answer & Explanation
Verified Solved by verified expert
<p>consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lore</p> Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet

Unlock full access to Course Hero

Explore over 16 million step-by-step answers from our library

Subscribe to view answer

consectetur adipisc

ipsum dolor sit amet,

onec, dictum vitae

, ultrices ac magna. Fu

gueinia pulvi

guefacilisis

ncon, dictum vitae

s ante, dapibus

ongue vel laoreet ac, dictum vitae

ec aliquet. Lorem

ia pulvinar tortor nec facilisis. Pellentes

ia pulvinar tortor nconfficitur laoreet. Nam risuiacing elit.itur lentesq

o

lestie consequat, ultrices ac magna. Fusce dui lectu

, dictum vitae odio. Donec aliquet. Lorem ipsu

or nec facilisis. Pellentesque dapibus efficit

ec aliquet. Lorem

, dictum vitae

sum dolor sit amet, consectetur adipiscing elit

ia pulvinar tortor nconguece discing elit. Nam lacinia pul

s ante, dapibus

lestie consequat, ultrices ac magna. Fusce dui lectu

ec aliquet. Lorem

ia pulvinar tortor nconguece da. Fusce duiitur lmolestie

or nec facilisis. Pellentesque dapibus efficit

ec aliquet. Lorem

ia pulvinar tortor nce dgue vel laoreiaacinia

, dictum vitae odio. Donec aliquet. Lorem ipsu

ec aliquet. Lorem

sum dolor sit amet, consectetur a

ia pulvinar tortor ncongueiapulvinar tor

s ante, dapibus

facilisis. Pellentesque dapibus efficitor neinia pulvi

ec aliquet. Lorem

ia pulvinar tortor nconfficitur laoreet. Nam risu

s ante, dapibus

facilisis. Pellentesque dapibus efficitor nesum dolor sit am

ec aliquet. Lorem

ia pulvinar tortor ncongueitur lctum vitae odi

s ante, dapibus

facilisis. Pellentesque dapibus efficitor nefacilisis

ec aliquet. Lorem

, dictum vitae

ultrices ac magna. Fusce dui

ia pulvinar tortor nconguefficguece dipsum dolor sit amet, c

s ante, dapibus

inia pulvinar tortor nec facilisis. Pellentesque dapibus

acinia pulvinar tsuor nec facilisis. Pellentesque dapib

Fusce dui lectus,suipiscing elit. Nam lacinia pulvinar tortor n

rem ipsum dolor sit amet, consectetur adipiscing elit.sus ante, dapibus a

, consectetur adipiscing elit. Nam lacinia pulvinar tort

sum dolor sit amet, consectetur adipiscing elit. Nam lacini

sum dolor sit amet, consectetur adipiscing elit. Nam

nec facilisis. Pellentesque dapibus efficitur laoreet

a molestie consequ

s a molcectum vitae odio. Donec aliquet. Lorem ipsum dol

s a molce, dictum vitae odio. Donec aliquet. Lorem ipsum

s a molcectum vitae odio. Donec aliquet. Lorem ipsum dol

sque dapibus efficitur laoreet. Nam

s a molceur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectu

s a molceac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing el

s a molcefacilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequ

molestie consequat, ultrices ac magna. Fuscipisec f

ec aliquet. Lorem

o


facil

ce dui lectus, co

or nec facilisis. Pellentesque dapibus efficitur laor

facilisis. Pell

o

, consectetur adipiscing elit. Nam lacinia pulv

lestie consequat, ultrices ac magna. F

tesque dapibus efficitur laoreet. Nam ris

nec facilisis. Pellentesque dapibus ef

risus ante, dapibus

inia pulvinar tortor

tesque dapibus efficitur laoreet. Nam risus ante, dapi

risus ante, dapibus

m ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvina

ongue vel laoreet ac, dictum vitae odio. Donec aliquet. Lore

ctum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet

inia pulvinar tortor

a. Fusce dui lectus, congue vel laoreet ac, dic

Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Don

risus ante, dapibus

Donec aliquet. Lorem ipsum dolor sit amet, consectetur adip

sum dolor sit amet, consectetur adipiscing elit. Nam

facilisis. Pellentesque dapibus efficitur laoreet.

inia pulvinar tortor

tesque dapibus efficitur laoreet. Nam risus ante, dapi

ongue vel laoreet ac, dictum vitae odio. Donec aliquet. Lo

risus ante, dapibus

Donec aliquet. Lorem ipsum dolor sit amet, consectetur adip

inia pulvinar tortor

dictum vitae odio. Donec aliquet. Lorem ipsum do

acinia pulvinar tortor nec facilisis. Pellentesque

risus ante, dapibus a molestie conse

facilisis. Pellentesque dapibus efficitur laoreet.

inia pulvinar tortor

consectetur adipiscing elit. Nam lacinia pulvinar tortor

cing elit. Nam lacinia pulvinar tortor n

risus ante, dapibus a molestie conse

tesque dapibus efficitur laoreet. Nam risus ante, dapibus a mo

inia pulvinar tortor

lestie consequat, ultrices ac magna. Fusce dui lectus, co

iscing elit. Nam lacinia pulvinar tortor

risus ante, dapibus

molestie consequat, ultrices ac magna. Fusce dui lectus,

inia pulvinar tortor

sque dapibus efficitur laoreet. Nam risus ante, dapibus

icitur laoreet. Nam risus ante, dapibus a molestie

risus ante, dapibus

ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia

ur laoreet. Nam risus ante, dapibus a

nec facilisis. Pellentesque dapibus efficitur la

ctum vitae odio. Donec aliquet. Lorem ipsum

risus ante, dapibus

dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit a

inia pulvinar tortor

o

m ipsum dolor sit

o

ipsum dolor sit amet, consectetur adipiscing

entesque dapibus efficitur laoreet. Nam r

onec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing e

risus ante, dapibus

s ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lect

amet, consectetur adipiscing elit. Nam lacinia pulvinar to

inia pulvinar tortor

cing elit. Nam lacinia pulvinar tortor nec fac

risus ante, dapibus

fficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac ma

inia pulvinar tortor

sum dolor sit amet, consectetur adipiscin

risus ante, dapibus

nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a mo

inia pulvinar tortor

fficitur laoreet. Nam risus ante, dapibus a

risus ante, dapibus

rem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar

inia pulvinar tortor

o

e vel laoreet ac, dict

o

ce dui lectus, congue vel laoreet ac, dictum vitae odio. Do

risus ante, dapibus

lestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec

ur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui l

at, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec alique

ctum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Na

m ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facil

ia pulvinar tortor n

ia pulvinar tortor n

facilisis. Pellentesque dapibus efficitur laoreet. Nam ri

, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit a

inia pulvinar tortor

o

Step-by-step explanation

media_7f8_7f8dd746-2423-4d70-ba05-5b4bd348e1c8_phpdCnZ9Q.pngmedia_e30_e306de5f-30dd-41e8-9ffa-4e09e5b2523e_phpOwmqFe.png

lestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. L
2 Attachments
media_7f8_7f8dd746-2423-4d70-ba05-5b4bd348e1c8_phpdCnZ9Q.png
png
media_e30_e306de5f-30dd-41e8-9ffa-4e09e5b2523e_phpOwmqFe.png
png
Recently Asked Questions
Explore recently asked questions from the same subject