Question
Finish the PetStoreInventory class that holds data about an item in a retail store. The class has the following fields: Description references a String object
Finish the PetStoreInventory class that holds data about an item in a retail store. The class has the following fields:
Description references a String object that holds a brief description of the item.
department references a String object that holds the department name this item belongs in.
numberOnHand an int variable that holds the number of units currently in inventory.
price a double variable that holds the items retail price.
Write a constructor that accepts arguments for the four fields, mutator methods for each field, and accessor methods for each field. In addition, write an instance method that calculates the total value of that item of inventory. You calculate the total value by multiplying the numberOnHand by the price, and return the value as a double.
You finish the PetStoreInventory class I started and is included in this zipped folder.
The TestPetStoreInventory class has already been written for you and is also in the zipped folder.
DO NOT CHANGE ANYTHING IN THE TestPetStoreInventory CLASS
When you compile the test program and the PetStoreInventory class, your output will look like this:
--------------------Configuration:
Description Department Units on Hand Price Total Value
=================================================================================
Item 1 0 $0.00 $0.00
Item 2 0 $0.00 $0.00
Item 3 0 $0.00 $0.00
Description Department Units on Hand Price Total Value
=================================================================================
Item 1 0 $0.00 $0.00
Item 2 0 $0.00 $0.00
Item 3 0 $0.00 $0.00
Process completed.
When completed, your output will look like this:
Description Department Units on Hand Price Total Value
=======================================================================================================
Item 1 Jack Russell puppies Dogs 4 $359.95 $1439.80
Item 2 Catnip Kitty Accessories 40 $4.95 $198.00
Item 3 Parrot Birds 2 $524.95 $1049.90
Description Department Units on Hand Price Total Value
=======================================================================================================
Item 1 Siamese kittens Cats 4 $359.95 $1439.80
Item 2 Catnip Kitty Accessories 17 $4.95 $84.15
Item 3 Parrot Birds 2 $179.95 $359.90
Process completed.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started