Description
In this homework you are expected to implement a “Basket Analysis Application” in Java.
You should fulfill the concepts of:
Object Orientation Fundamentals,
Abstract Data Types
Inheritance, Polymorphism, Abstract Classes, Interfaces, Exceptions
Collections Generics
CSV file I/O
In the Basket Analysis Application, there are the product records and the basket records of an
online shopping application which sells electronic, clothing, and cosmetic products. The
product records show the information of each product. The basket records show the detail of
purchases that made in the year 2021. These details are which products are sold, the quantity
and the price of the associated products and the date of purchases. Due to the inflation and
periodic discounts, the product prices are changing in the records.
In this homework, you are expected to implement necessary classes to load the data from the
given CSV files and create the desired queries. The given CSV files are listed below.
In “products.csv”, the information is given for different products. The first entry of
each line is the product ID. The product ID consists of the abbreviation of the
associated product category and a number. Each abbreviation is given for each
different product category below in the table.
The common fields of different
products are given as bold and other fields are given in the order as in the csv file.
For instance, the csv information is given in the order (as in the table) product ID,
title, RAM capacity, SSD capacity, CPU for the product PC in the CSV file.
Product Name Abbreviation Field(s)
Electronic EL title
PC ELPC RAM capacity, SSD capacity, CPU
Monitor ELMO screen size
Phone ELPH memory capacity
Headphone ELHE Bluetooth version
Clothing CL brand, size
Coat CLCO coat type
Skirt CLSK hemline
Cosmetic CO brand, ML
Perfume COPE fragrance type
Lipstick COLI lipstick type, color
In “baskets.csv” the information is given as follows:
basket ID, product ID, price, quantity, …., purchase date
The product ID, price and quantity are repeated for each different product in the basket in
the csv file. The last entry of each line in “baskets.csv” shows the date of purchase.
You are expected to implement necessary classes and other helper classes. Please note that,
the basket will be a data structure that can store different products (electronic, clothing, and
cosmetic), their price and their quantities by considering that the product variations could be
improved in the future, e.g., a new product category such as Book could be added.
After creating the product and the basket objects, please display the results of the following
queries:
1- The revenue from COLI-1 product.
2- Top selling product by quantity.
3- The most paid basket.
4- Basket with the largest number of different products.
5- The month in which the ELPC-1 was sold the most expensive.
6- Price increase rate of ELHE-2 in July.
If the result of any of the query is more than one, please display all results.
Important Notes:
1. Do NOT request inputs in your app. Printing the results of the queries will be enough.
You should print names of the results instead of printing IDs or indices. An example
imaginary output is given below:
2. You should use relative paths (e.g. Files/sample.csv) instead of absolute paths (e.g.
C:\\user\\eclipse-workspace\\MyProject\\Files\\sample.csv).
3. To support Turkish characters, you may need to change your project’s text file encoding
to UTF8: Right click on your project (in package explorer) → Properties → Text file encoding
→ Other → UTF8 → Apply.
4. You are expected to write clean, readable, and tester-friendly code. Please try to
maximize reusability and prevent from redundancy in your methods.
Assignment Rules:
1. In this lecture’s homework, there are no cheating allowed. If any cheating has been
detected, they will be graded as 0 and there will be no further discussion on this.
2. You are expected to submit your homework in groups. Therefore, only one of you will
be sufficient to submit your homework.
3. Make sure you export your homework as an Eclipse project. You can use other IDEs as
well, however, you must test if it supported by Eclipse. If the project import is not
accomplished in Eclipse, you will lose points.
4. Submit your homework through Cloud-LMS.
5. Your exported Java Project should have the following naming format with your assigned
group ID (which will be announced on MS Teams) as the given below:
G05_CENG431_HW1
Also the zip folder that your project in should have the same name
G05_CENG431_HW1.zip
6. Please beware that if you do not follow the assignment rules for exporting and naming
conventions, you will lose points.
7. Please be informed that your submissions may be anonymously used in software
testing and maintenance research studies. Your names and student IDs will be replaced
with non-identifying strings. If you do not want your submissions to be used in research
studies, please inform the instructor (Dr. Tuglular) via e-mail.