COMP2247 - Algorithms and Data Structures

Syllabus Software Installation Assignments Tests
Lectures and Labs
**Back to Full Menu**

Review COMP2243 Materials ArrayProcessing.java Hardware Store Program
Inventory.java
HardwareStoreClient.java
Hardware_data.txt




Review COMP2243 Materials


In this section, we will write two programs to review the materials we studied in COMP2243.

1. The first program creates an array of int to store 25 integers and then uses several methods to fill in the array with random numbers, calculate the total value of the array elements, find the smallest element in the array, search a particular element in the array, and sort the array.

2. The second program is a large OOP program.

It defines a class Inventory to represent hardware store products and uses an array of Inventory to organize Inventory objects.

The inventory data is stored in an external file. The program reads the data in the file to populate the array.

The users can print the inventory, search a particular product, calculate the total value of inventory, and etc.