Computer Science Homework Solutions
Problem
#174324

Java: How to Program

Modify the Inventory Program so the application can handle multiple items. Use an array to store the items. The output should display the information one product at a time, including the item number, the name of the product, the number of units in stock, the price of each unit, and the value of the inventory of that product. In addition, the output should display the value of the entire inventory.
• Create a method to calculate the value of the entire inventory.
• Create another method to sort the array items by the name of the product.

This statement CANNOT be in the code:
List list = new ArrayList ();
"product" is not showing for some reason
I guess this is not how I am supposed to create the array.

The first OTA included that statement for the first part which I have attached. It is the file inventorypart1 that needs to be modified and the statement "List list = new ArrayList ();" be taken out.



It is very important not to add anything extra

I have attached examples according to the class instructor and also the reading material.

Any questions please post them before posting the solution.

The product.java does not need to be changed, I included it for reference.

Thank you

Attached file(s):
Attachments
Sample array of objects.doc  View File
Part II instructions.doc  View File
Week six.pdf  View File
InventoryPart1.java  View File
Product.java  View File
Solution
What is this?
By OTA - Overall OTA Rating
Yupei Xiong, PhD - 4.8/5
Purchase Cost Now
$2.19 CAD (was ~$23.94)
Included in Download
  • Plain text response
  • Attached file(s):
    • InventoryPart2.java
    • Product.java
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
  • Java: How to Program - Choose a product that lends itself to an inventory (for example, products at your workplace, office supplies, music CDs, DVD movies, or software). Create a product class that holds the item number, ...
  • Create a ClickOnce local data source deployment for your completed file application - Create a ClickOnce local data source deployment for your completed file application. Be sure to choose the local path (e.g., a CD) type of deployment. Additional Notes Pay close attention to the ...
  • Creating a Java Inventory Program - I have been collecting golf balls from different courses over the years now. Of right now I have an inventory of over 200 golf balls from different courses. Each golf ball has its own logo (golf cours ...
  • Please modify this program so the application can handle multiple items. - Please modify this program so the application can handle multiple items. Use an array to store the items. The output should display the information one product at a time, including the item numb ...
  • Java Beginner - Fundamental Java - In plain fundamental Java how would I use an array to come up with the following. Please show how this is done in Java format. Not C++ or anything like that. ?Modify the Inventory Program so the ap ...
Browse