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

Assignment: Object-oriented Programming

Assignment Descriptions:

Create a Java Console application bases on Java Classes/Objects, OOP, Exception Handing,
IO, Java Collections to manage Device (Device Management)
Refer to the class hierarchy which is described below, trainees need to create Java classes in
order to implement the entities.
Functional Requirements:
Function 1: Create device (2 marks)
• Require to input a user information include id, name, ram, cpu, hdd, weight and color.
• Check the valid data with the following conditions:
• id is not allowed to duplicate.
• name s not empty and must be at least five characters.
• ram is an integer number and ranges from 2 to 128
• cpu is number and ranges from 1 to 10
• hdd is an integer number and ranges from 128
• weight is number and ranges from 0.5 to 8
• color is not empty and is a valid color representation as red, white, blue, gray

Function 2: Display all devices - (2 marks)


• Displaying list devices information order by name descending. If the same name, then order by id
ascending

Function 3: Update device - (2 marks)


• The user enters the id from the keyboard
• If it does not exist, the notification "Device does not exist". Otherwise, the Device can edit the
remaining information. If Information is blank, then do not change old information
• Show the result of the update: success or failure

Function 4: Delete device - (1 marks)


• The user enters the id from the keyboard
• If it does not exist, the notification "Device does not exist". Otherwise, the Device can be deleted
• Must show confirm message
• Show the result of the delete: success or fail

Function 5: Find device information by name - (2 marks)


• Require enter a search string (a part of name), return a list device information contain search
string.
• If the list device is null, the notification "Have no any device", else print the list user information
order by name.

Bonus 1 mark if the student save data to file in this project.

2/3
User Interface Requirements:

The main screen allows user to select the following functions:

Menu

====== Device Management ======


1. Create
2. Display all
3. Update
4. Delete
5. Search by name
6. Save to file
7. Quit
Please choose function you'd like to do:

Guildelines:

• Create a project named DeviceManagement, create package device.entities that


contains classes: Computer, PC, Laptop.
• The package device.utils to implement Validation Rules requirements.
• Create a package named device.main contains DeviceList class.

-- THE END --

3/3

You might also like