Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem two - inventory(java) Createe two classes. The Inventory class and the TestInventory class. The Inventory class has two arrays. The first array is of

Problem two - inventory(java)

Createe two classes. The Inventory class and the TestInventory class.

The Inventory class has two arrays. The first array is of type String and is called PartName. It is of size 3. It contains: "Hammer", "Shovel","Brick".

The second array is of type integer. It is a 2 dimension array. It's name is PartCount. It is sized 2 columns by three rows. The 0th column of PartCount has values: 23, 33,100.The 1st column has three zeroes.

Creat a method in Inventory, called Update, that has a return type of zero and takes two arguments. The first argument is of type String and second is of type integer. Use the String argument to find the matching String in the PartName array. Use the index of the PartName value to update the 1stcolumn of the PartCount array.

Creat a second method that creates a report of the inventory called InventoryReport. It has a void return type $ takes no arguments. Once called, InventoryReport should display the PartName, the first and second column of PartCount and the difference of the two values in PartCount. For example it might display: Hammer 23 19 4Shovel 33 45 12 Brick 100 20 80.

The second class is TestInventory. It has a main method. It creates an object of type TestInventory. It asks the user for what Item to update and how many there are. It then calls the Inventory method Update, passing the two values. It asks the user if there are any more items to input and calls Update as needed. Once the user has no more updates, the program calls the InventoryReport method of the Inventory class.

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

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions

Question

Explain the market segmentation.

Answered: 1 week ago

Question

Mention the bases on which consumer market can be segmented.

Answered: 1 week ago

Question

Explain consumer behaviour.

Answered: 1 week ago

Question

Explain the factors influencing consumer behaviour.

Answered: 1 week ago