Enterprise programming - describe elements of a common


Individual Assignment

Overview

This assignment requires you to analyse a problem and to design and implement a solution. The tasks require you to demonstrate your understanding of the programming concepts covered in Weeks 1-4 of the course: Setting the foundations and a brief introduction to the course and to the Java programming language, and Exceptions, I/O and Multithreading.

Learning Outcomes Assessed

1. Describe elements of a common object oriented programming language suitable for web based application development

2. Develop applications involving complex component technology

3. Design and implement technical solutions addressing connectivity between components

Assessment Details

Consider a company XXX sells electronic products. There are three types of products they sell, namely (i) Smart Phone, (ii) Television and (iii) Laptop. The following table lists the product descriptions that are stored for each individual product type.

Smart Phone

Television

Laptop

Warranty

Warranty

Warranty

Brand Name

Brand Name

Brand Name

Screen Size

Screen Size

Screen Size

Storage

Energy Rating

RAM

 

Weight

Operating System

Task 1: Create an appropriate hierarchy of classes using Inheritance. Place the product description fields in super class or subclass, where it is appropriate. Define constructors and proper get and set methods for all the fields.

The company XXX maintains a stock of their products. It imposes restrictions on the quantity of each individual product they stock as well as an overall restriction on the total number of products they can store. While stocking the products in the storage, they maintain a digital repository. The repository can be populated using a file or can be manually entered from the console. Consider the file "Stocks.txt" as the template for populating the repository.

Task 2: Define a class "Stocks" whose object can be used as the repository. Moreover define an Interface "StockLimit" that will define the maximum number of each products and the maximum number of total stock that XXX can store in its repository.

Task 3: Define a method to read the text file "Stocks.txt" and generate objects of the corresponding type of product using the corresponding classes' constructor. You are to create as many objects as indicated by "Quantity" in "Stocks.txt".

Task 4: Maintain the current level of stocks for each element and check it with the maximum limit (as defined in Task 2) before creating the product objects in Task 3. Moreover, define an exception class "StockLimitException" and throw it when the total stock limit is reached to abort further attempt to create product objects. Also include appropriate try-catch block.

Task 5: Similarly, define a method to populate the product objects from Console using the same format as described in "Stocks.txt"

Task 6: Save the current repository in a file (ex., "Repository.txt"). Create one record for each product in your digital repository and write the quantity field as 1.

Task 7: Define an appropriate test class with main function to demonstrate the functionalities of your code.

Your assignment should be completed according to the General Guidelines for Presentation of Academic Work.
The following criteria will be used when marking your assignment:
- successful completion of the required tasks
- quality of code that adheres to the programming standards for the course including:
- comments and documentation
- code layout
- meaningful variable names
- use of constants

You are required to provide documentation, contained in an appropriate file, which includes:

a front page - indicating your name, a statement of what has been completed and acknowledgement of the names of all people (including other students and people outside of the university) who have assisted you and details on what parts of the assignment that they have assisted you with.

Attachment:- Java.rar

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Enterprise programming - describe elements of a common
Reference No:- TGS02276067

Now Priced at $45 (50% Discount)

Recommended (95%)

Rated (4.7/5)