300581 programming techniques programming project - your


Project requirements

For the problem described in the next section, you must do the following:

1. include your student ID at the end of all filenames for all java code files. Three classes have been identified in section 3.4 as being re- quired as part of your solution. Do not modify the names of these classes except for adding your student ID to the end of the filename. Other Java files will be needed as part of your solution. All Java code files that are used in this assignment MUST have your student ID ap- pended to the filename. For example, Dealer ########.java;

2. include your authorship details at the top of each file in code com- ments (see Section 4 of this document for details);
3. adhere to the coding standard as identified in the Google Java Style Guide (see Section 4 for details);
4. ensure that standard Input/Output are used in all code segments - do not use Swing;
5. ensure that your Java code is appropriately modularised for the given problem definition. That is, you need to write appropriate classes and methods to solve the problem;
6. not use any dynamic data structures such as arraylists. If you are unsure if you can use a particular data structure check with the unit coordinator first;
7. reference all sources that you used for inspiration of your solution as per Section 5 of this document;
8. Ensure that your Java code compiles and runs in Eclipse Oxygen.3
(as installed on the lab machines).

3 Project Details
General information
Your task is to create a menu-driven Java program using object-oriented code to manage the inventory of cars held by a network of used-car deal- ers. Your program will implement a strictly limited set of functions (i.e. not a real-world implementation), allowing the user to make adjustments to the inventory as dealers buy and sell cars, to generate inventory reports, and to retrieve and save data in secondary storage (in this case, text files). In general, your program will need to read data from the keyboard and from certain text files in secondary storage, store the data in appropriate data structures using objects, sort and search the data, and write output
data to both the screen and to secondary storage.

The following sections of this document describe:
- specific functional requirements;

- text files that are to be used;
- classes that must be used as a minimum.

Program requirements and functionality

Basic requirements
The Java program must:
1. be object-oriented using the classes described below as a minimum. Other classes may also be needed to solve the program requirements;
2. be menu-driven. The main menu must have the following menu items:
1. Adjust Dealer Inventory
2. Inventory Report
3. Save
4. Exit Program

3. be able to process the defined text files. The text files and their for- mats are described below.

Program Start-up
When the java program starts it must perform the following file related operations:

1. Read the data from the dealers.txt file into computer memory into an appropriate array of objects (see below for a description of the dealers text file and for a description of the dealer class). If the dealer file does not exist then the user should be informed of this and given the opportunity to provide an alternative filename that contains the dealer data;

2. Read the data from the inventories.txt file into computer mem- ory into an appropriate array of objects (see below for a descrip- tion of the inventories text file and for a description of the Inventory class). If the inventories file does not exist then the user should be informed of this and given the opportunity to provide an alternative filename that contains the inventory data;

3. Read the data from the cars.txt file into computer memory into an appropriate array of objects (see below for a description of the cars text file and for a description of the Car class). If the cars file does not exist then the user should be informed of this and given the opportunity to provide an alternative filename that contains the cars data.
After processing these three files the program should display the main menu identified above.

Main menu item functionality
The required functionality for each menu item is described as follows:

1. Adjust Dealer Inventory - when this menu option is selected the following actions should be performed by the program:
- Find the dealer whose inventory is to be adjusted.
Identify which car they have bought or sold. If the dealer holds that particular car in inventory, it may be bought or sold; otherwise, it may only be bought.
- determine if the car has been bought or sold by the dealer
make the inventory adjustment (ensure your program takes into ac- count all logical validation conditions when doing so).
generate an on-screen summary of the inventory adjustment. The summary must show the dealer name and address, inventory ID, current date, car ID, make, model and year, and the price of the car. Make sure that this is displayed in a clear and logical format on the screen.

2. Inventory Report - when this menu option is selected the following actions should be performed:
- Determine if the report is for all dealers or for a specific dealer;
generate the Inventory Report for either all dealers or the specified dealer. The Inventory Report should have a similar layout to the following example:

3. Save - the program must write the inventories data back to the In- ventories text file (dealer and car data will not have changed so need not be written back to the files).

4. Exit Program - the program must terminate when this menu item is selected. The program should not terminate until this option is chosen. If the inventory data have changed since the last save then do not exit the program. Instead, warn the user that they should choose the Save option, then return program control to the main menu.

Text files to be processed
The data that are to be manipulated by your Java program for this assign- ment are contained in the text files dealers.txt, inventories.txt, and cars.txt. Examples of these text files are found in the .zip file for the assignment.
The data within these text files will need to be read into memory by your program so that they may be manipulated to carry out the required functionality of the assignment. The text files have been created to con- form to a particular format. The format for each file is described below.

File: dealers.txt This file contains a full record of all dealers in the net- work. Each line in the file represents an individual dealer with the follow- ing format:
Dealer ID, Dealer Name, Dealer Address, Inventory ID where each data item is separated by a comma (,).
Data items:
Dealer ID: a unique numeric identifier for a dealer
Dealer Name: the dealer name, which may contain spaces

Dealer Address: the dealer's address
Inventory ID: a unique identifier for the dealer's inventory of cars A dealers file has been provided in the assignment .zip file.

File: inventories.txt This file contains a full record of all dealer invento- ries. Each line within this file represents an individual inventory of cars for a dealer, and has the following format:
Inventory ID, [carID] 10
where each data item is separated by a comma (,).
Note: An inventory can contain up to 10 different cars, so the carID may be repeated up to 10 times.
Data items:
Inventory ID: a unique identifier for the dealer's inventory of cars. carID: a unique identifier for a particular car.
Two (2) inventory files have been provided in the assignment .zip file.

File: cars.txt - This file contains a full record of all cars that can be bought or sold by the dealers. Each line within the file represents a car and has the following format:
CarID, Make, Model, Year, Value
where each data item is separated by a comma (,).
Data items:
carID: a unique identifier for a particular car. Make: the make of the car
Model: the model of the car
Year: the year of the car's manufacture Value: the value of the car in dollars
A cars file has been provided in the assignment .zip file.

Notes:

1. When reading the text files into memory the data should be read into appropriate array(s) of objects. The classes for these objects are briefly outlined below.

2. For the purpose of marking the assignment the number of lines of data and the data values in the text files will be replaced with dif- ferent data by the marker. This is to ensure that your solution has not relied upon specific data values or the number of lines in the text files to work. You should therefore test your program with different data files of varying length and varying data before submission.

Attachment:- project.zip

Solution Preview :

Prepared by a verified Expert
JAVA Programming: 300581 programming techniques programming project - your
Reference No:- TGS02937461

Now Priced at $60 (50% Discount)

Recommended (99%)

Rated (4.3/5)