Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

www.oracle.

com/academy

Java Fundamentals
Section 6: Creating an Inventory Project
Project

Overview
This project will progress with you throughout the course. After each section there will be more to add until it builds into
a complete Java application to maintain Inventory. For each part, build upon the last part so that both the old and new
requirements are met. Include all parts in a package called javaInventory.

Create an inventory program that can be used for a range of different products (cds, dvds, software, etc.).

Requirements - (Solutions: ProductPart3, ProductTesterPart3)

At this point, students should create new classes ProductPart3 and ProductTesterPart3 that will add onto the
functionality of Part 2 of the project. (copy and paste part 2 code into new part 3 classes)

Topic(s): Arrays of objects, for loops

1. Modify ProductTesterPart3 to handle multiple products using an array of Products.

2. Ask the user to enter the number of products they wish to add. Accept a positive integer for the number of
products, and handle the value of zero.

3. Using a for loop, ask the user to input the values for the items.

4. Use another for loop to 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.

Note : Object class ProductPart3 is the same as ProductPart2 – no modifications necessary.

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.

You might also like