You are required to createa stock management system for a media store. To do this, you must create the classes depicted in the UML class diagram shown below, then employ these classes in a management application. Once these classes

Programming 1 – CA2 – 45%

General description

You are required to createa stock management system for a media store. To do this, you must create the classes depictedin the UML class diagram shown below, then employ these classes in a management application. Once these classes have been completed, you are required to create a GUI-based application that repeatedly offers the range the functionality listed below (until the user chooses to exit). Your application should be able to store an unlimited number of StockItem objects in an appropriate data structure.

UML class diagram

Details for class methods (20%)

In addition to the constructors included in the classes depicted above and the getters and setters for all attributes (not shown in diagram), there are a number of “behaviour” methods (i.e. methods that provide functionality/logic) shown. The logic for these methods is outlined below:

“Good Practice” methods– ToString, Equalsand GetHashCode

All attributes should be included in the computation/logic of these methods.

CalculateProfit methods

The formula to calculate the profit on a StockItem is (price * 20%) The formula to calculate the profit on a CD is (price * 10%)

The formula to calculatethe profit on a DVD is (price* (NumDiscs * 5)%)

CalculateAverageSongLength method

This methodshould calculate the averagelength of a song (in minutes) on a CD based on the numberof songs on that CD and the length of the content on that CD.

Functionality (40%)

You are required to provide the following piecesof functionality withinyour application:

1. Add a new product – The user should be prompted to select the type of product they wish to add (i.e. a StockItem, a CD or a DVD) and then to enter the relevent information for that type of product. The product should then be added to your data structure store of StockItems.

2. View catalogue – The application should display the information (in full) of all stock items storedwithin the application.

3. Search for a product – The user should be allowed to select from the following search options:

a. By name – the user should be prompted to enter the name of the product being searched for

b. By artist – the user should be prompted to enter the artist being searched for.

In both cases, the user should be informed if no match is found.In cases where a singlematch is found,its information shouldbe displayed in full to the user. In cases where multiple matches are found, the FIRST match found should be displayed to the user and subsequent matches should be ignored.

4. Find the item with the lowest/least… – The user should be allowed to select from the following two options:

a. Find the DVD with the lowest rating

b. Find the stock item with the lowestsales

In all cases, the application should display the information (in full) for the final result. Where more than one item has the same information, the first instance should be displayed.

5. Find the item with the highest/most… – The user should be allowed to find the item with the highest profit margin. The application should display the information (in full) for the final result. Where more than one item has the same profitmargin, the first instance should be displayed.

6. Calculate number of items… – The user should be allowed selectfrom the following options:

a. How many items are storedwithin the application

b. How many multi-disc DVDs are stored within the application

7. Exit – The application should ask the user to confirm they wish to exit. If the user says yes, the application should display a farewellmessage and shut down.

Design (20%)

Code design

Your code should be well-designed, with classes and methods used where appropriate. Your main methodshould call staticmethods where useful, rather than including all code providing functionality. Exceptions should be handled where they are anticipated, i.e. where numericdata is taken from the user.

Interface design

Your interface should be clear and easy to understand. When displaying data on items, all information should be clearly labelled. When requesting data from the user, the information needed should be clearly stated.Screenfuls of data should be broken up, rather than flashing past and requiring the user to scroll back up.

Code Walkthrough and Explanation with video (20%)

You should submit a short video as part of the project which includes a code walkthrough and a short demonstration.

Submission Details:

Submit a zipped folderof your code to Moodle. Your code shouldinclude explanatory commentsthroughout.

Deadline:            11:59pm Friday 31stMarch 2023

Reference no: EM132069492

WhatsApp
Hello! Need help with your assignments? We are here

GRAB 25% OFF YOUR ORDERS TODAY

X