Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Students also viewed these Databases questions

Question

Explain the factors influencing wage and salary administration.

Answered: 1 week ago

Question

Examine various types of executive compensation plans.

Answered: 1 week ago

Question

1. What is the meaning and definition of banks ?

Answered: 1 week ago

Question

2. What is the meaning and definition of Banking?

Answered: 1 week ago