Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

create a simple java application for a rug store. The store manages the rug info

ID: 3696613 • Letter: C

Question

create a simple java application for a rug store. The store manages the rug information this is stored in Comma Separated Values (CSV) file (CSV files can be open using Excel OR text editor. This file is attached and must be used read & processed in your java application). This file has the following information for each rug (modelNumber, origin, price, dimensions, weight, and amountInStock). The business owner wants to automate the process when dealing with this file. So, the user should choose option (1) to print out all rugs' information. Option (2) adds rug to the rug file information (if the new rug’s modelNumber is NOT exist in the .cvs file, then add it as brand new rug. Otherwise, if the new rug’s modelNumber is in stock, increase the amountInStock by one). Option (3) is for creating an order. The user enters the modelNumber and the amount he needs. If it is in stock, decrease the amountInStock by one. If it is not in stock (amountInStock<=0), the system throws an exception but must report the error and continue to work normal. The check out process must create a folder called “output” and print a receipt to a text file. This receipt includes modelNumber, price, amount, and the total. Option (4) is to exit the application.

1- Consider each rug as an object.

2- Must implement techniques studied in this course (Store objects in collection, Encapsulation, Inheritance, and Polymorphism (overloading i.e. for adding a rug with some information is missing & overriding i.e. for print receipt)).

3- Must be resist to crash. That is, your java application MUST behave normally in all cases and must not exit the application without entering (4). For example, the application should not exit if the user enters string instead of integer, call object with unavailable modelNumber, insert a brand new rug with some information are missing… etc.

4- “Must implement techniques studied in this course (Store objects in collection, encapsulation, overloading i.e. for adding a rug with some information is missing)."

Explanation / Answer

Field

Data type

Constraint

Organisationid

Varchar2 (10)

Primary key

Org_short_name

Varchar2 (50)

Org_full_name

Varchar2 (200)

Address

Varchar2 (100)

Street

Varchar2 (100)

City

Varchar2 (100)

Phone

Varchar2 (50)

url

Varchar2 (50)

Log table

Field

Data type

Constraint

Organisationid

Varchar2 (10)

Primary key

Org_short_name

Varchar2 (50)

Org_full_name

Varchar2 (200)

Address

Varchar2 (100)

Street

Varchar2 (100)

City

Varchar2 (100)

Phone

Varchar2 (50)

url

Varchar2 (50)