Description
Homework 1 CENG431 – Building Software Systems
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.
Homework 2 CENG431 – Building Software Systems
In this homework you are expected to implement and design a “Uncontrolled Junction Simulation” in
Java. You should fulfill the concepts of:
• Mediator Design Pattern
• UML Class Diagrams
• UML Sequence Diagrams
• UML State Diagrams
1. In this application you are expected to implement a simulation of a 4-way uncontrolled
intersection. In the simulation 20 vehicles will be randomly generated and the simulation will
show the user right-of-way for the vehicles.
2. Vehicles for the simulation will be as shown in the table:
Vehicle Motor Type Generation Probability
Car Motor Vehicle 35%
Bus Motor Vehicle 10%
Truck Motor Vehicle 10%
Motorcycle Motor Vehicle 15%
Tractor Motor Vehicle 10%
Engineering Vehicle Motor Vehicle 5%
Bicycle Non-motorized Vehicle 10%
Horse-drawn Vehicle Non-motorized Vehicle 5%
3. Roads for the intersection should be numbered from 1 to 4 and should be in clockwise:
1
4 2
3
4. Steps for generating vehicles should be as follows:
a. First generate a vehicle according to generation probability which is given in the table
above.
b. Then decide randomly on which road the generated vehicle will be placed. There are four
roads as given above and each have the same probability for placement.
c. Lastly decide randomly the direction of the vehicle. The vehicle may want to go straight,
turn right, or turn left.
5. The rules for the right-of-way are as follows:
a. Non-motorized vehicle should give way to motor vehicles no matter their directions.
b. Tractors or engineering vehicles should give way to other motor vehicles no matter their
directions.
c. Vehicles should give way to traffic approaching from the right (For example: a car on the
3
rd road should give way to a car on the 2nd road).
d. Vehicles should give way if they will turn left (For example: a car on the 2nd road should
give way to a car on the 3rd road if the car on the 2nd road will turn left. However, if both
cars will turn left, the rule in the section c is applied).
e. All vehicles should give way to pedestrians.
f. If there is a case happen where all the vehicles have the same passage right, then give
the right-of-way to the vehicle on the 1st road.
g. If there is a case happen where both vehicles on the roads have the same passage right,
then give the right-of-way to the vehicle on the road with smaller index number (e.g., in
case with 2nd and 4th roads, then give the right-of-way to the vehicle on the 2
nd road)
6. Simulation will work round by round. In each round a vehicle will go to its chosen direction. In
each round there is possibility of generation of a pedestrian which is 10%. If a pedestrian is
generated, their road of crossing also will be decided randomly (e.g., 4th road). A pedestrian will
cross the road in 2 rounds.
7. You are expected to print the short results to the console after simulation is completed. Short
result will be as in the example output:
Vehicles:
1
st road:
1. Car (Go Straight)
2. Car (Turn Right)
3. Bus (Turn Left)
4. Bicycle (Go Straight)
5. Truck (Turn Left)
6. Car (Turn Left)
2
nd road:
1. Car (Turn Left)
2. Motorcycle (Turn Right)
3. Engineering vehicle (Go Straight)
4. Car (Turn Left)
5. Bicycle (Turn Left)
3
rd road:
1. Bus (Go Straight)
2. Car (Turn Left)
3. Tractor (Turn Right)
4. Car (Turn Right)
4
th road:
1. Car (Turn Left)
2. Car (Go Straight)
3. Horse-drawn vehicle (Turn Right)
4. Motorcycle (Turn Left)
5. Car (Go Straight)
Right-of-way:
1. Car on the 1
st road went straight
2. Car on the 1st road turned right
3. Bus on the 3rd road went straight
4. Bus on the 1st road turned left
5. Car on the 2nd road turned left
A pedestrian is waiting on the 2nd road
6. Car on the 3rd road turned left
The pedestrian is crossing on the 2nd road
7. Car on the 4th road turned left
8. Motorcycle on the 2nd road turned right
.
.
.
8. You are also expected to save extended results to a text file SimResult.txt as follows:
a. Generation information for each vehicle
b. Vehicles on the junction will be printed for each round (as in the short results, but for
each round a vehicle will not be on the list since it left the junction in the previous
round).
9. You are expected to draw a UML Class diagram, a UML Sequence diagram, and a UML State
diagram for your program.
Important Notes:
1. Do NOT request inputs in your app. Printing the results of the queries will be
enough.
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.
CENG431 – Building Software Systems Homework 3
In this homework you are expected to implement an “Music Player Application” with a
GUI. You should fulfill the concepts of:
SOLID Principles
MVC Design Patterns
Swing
Observer Design Pattern
In this platform, the users can like the songs they listen and create playlists up to their interest.
There are 5 types of playlists which are Sleeping, Workout, Dining, Meditation and Road
Trip. Also, the users will see other users’ playlists.
The GUI of the Music Player Application allows users:
To login
To listen a song by pushing a play button
To create a playlist of songs
To add/remove song from the playlist
To like the song
To follow/unfollow other users
To view the followed users’ playlists
The songs’ information is stored in a TXT file of the following form:
genre_id,track_id,song,artist,duration,popularity,number_of_likes
On this platform, there are 6 types of genres which are Acoustic with id 1, Instrumental with
id 2, Rock with id 3, Hip-hop with id 4, Jazz with id 5 and Pop with id 6. Note that, track
duration is given in seconds, and track popularity refers to the number of plays. All this
information belong to songs will be displayed on this platform.
The created playlists on this platform, should be written on JSON file with the following
information:
playlist_id,creator_user_name,playlist_name, playlist_type, number_of_songs, duration,
song_list
The user must enter the playlist name as an input and select one of the playlist types mentioned
above. Each time a new song is added to a playlist, the JSON file and the page that shows
playlists’ information should be updated. There should be no duplicate songs in the playlists.
There will be also a statistics page which will show the followings:
The most liked song
The most popular song
The most followed user
The shortest and longest playlists
Every time a user pushes the play button to listen to a song and/or performs a like operation,
the TXT file should be updated the popularity and/or the number of likes of the associated song.
Furthermore, if any of these operations affect any of the user’s playlists or the statistics page,
these changes should be applied on these as well.
The user information is stored in an XML file file with the following information:
user_name,password,following_user_names,follower_user_names
When a user performs follow/unfollow operation the XML file should be updated. You should
create an XML file which consists of at least 5 users including the instructor and the teaching
assistants of this course. The playlists, following users and follower users should be
displayed on a user’s profile page.
Both the txt and the XML files should be loaded first when the program starts. After a user
create a playlist, the JSON file should be created too, and it should be updated when necessary.
NOTE: Please try your best to make your software user friendly and make sure it is expressive
enough to the user.
Usability Testing: If you have enough time you can create a check list of every functionality
that your software has and ask your friends to perform each functionality without giving them
any hint. If your friends succeed in every functionality, then your software’s usability is quite
high.
Project Submission Rules
1. Cheating is not allowed. If any cheating has been detected, they will be graded with 0
and there will be no further discussion on this.
2. You are expected to submit your project in groups. Therefore, only one of you will be
sufficient to submit your project.
3. Make sure you export your project as Eclipse projects. You can use other IDEs as
well, however, you must test if it supported by Eclipse.
4. If you are using an external library, make sure that “.jar” library is in your project after
you exported it. Unfortunately, from our previous experiences we have encountered
project submissions that uses libraries from their “Desktop”.
5. Please submit your project through Cloud-LMS (https://cloud-lms.iyte.edu.tr/).
6. Please export your Java Project as the given format with your assigned.
Example:
G02_CENG431_Midterm3.zip. (Your group IDs will be announced on Microsoft
Teams).
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.
CENG431 – Building Software Systems Homework 4
In this homework you are expected to implement and design a “Pizza Order Application” in Java. You
should fulfill the concepts of:
• Factory Design Pattern
• Decorator Design Pattern
In this application user can order a pizza according to their choice of pizza shop, pizza type, and pizza
toppings
Related information about the shops is given below:
Shop Name: Pizza Globale
Pizzas:
• Goat Cheese Pizza – Info: Tomato Sauce, Mozzarella Cheese, Goat Cheese – Cost: 60₺
• Margherita Pizza – Info: Tomato Sauce, Mozzarella Cheese, Cherry Tomato, Basil Leaves – Cost:
60₺
• 4 Cheeses Pizza – Info: Tomato Sauce, Mozzarella Cheese, Roquefort Cheese, Parmesan
Cheese, Feta Cheese – Cost: 55₺
• Barbeque Chicken Pizza – Info: Tomato Sauce, Mozzarella Cheese, Chicken Slices, Barbeque
Sauce – Cost: 54₺
• Smoked Ribs Pizza – Info: Tomato Sauce, Mozzarella Cheese, Smoked Ribs, Arugula Leaves,
Parmesan Cheese – Cost: 70₺
Toppings:
• Parmesan Cheese – Cost: 5₺
• Olive – Cost: 4₺
• Sweet Corn – Cost: 3₺
• Ricotta Cheese – Cost: 4₺
• Red Pepper – Cost: 8₺
• Sausage – Cost: 9₺
• Pepperoni – Cost: 8₺
• Pastrami – Cost 10₺
• Basil Leaves – Cost 6₺
• Cherry Tomato – Cost 7₺
• Mushroom – Cost: 6₺
Shop Name: Pizza Hat
Pizzas:
• Ranch House Pizza – Info: Tomato Sauce, Mozzarella Cheese, Salami, Mushroom – Cost: 50₺
• Margherita Pizza – Info: Tomato Sauce, Mozzarella Cheese, Cherry Tomato, Basil Leaves – Cost:
53₺
• Pepperoni Pizza – Info: Tomato Sauce, Mozzarella Cheese, Pepperoni – Cost: 48₺
• Barbeque Chicken Pizza – Info: Tomato Sauce, Mozzarella Cheese, Chicken Slices, Barbeque
Sauce – Cost: 57₺
Toppings:
• Parmesan Cheese – Cost: 4₺
• Olive – Cost: 3₺
• Sweet Corn – Cost: 3₺
• Ricotta Cheese – Cost: 5₺
• Sausage – Cost: 8₺
• Pepperoni – Cost: 8₺
• Salami – Cost 9₺
• Basil Leaves – Cost 5₺
• Cherry Tomato – Cost 6₺
• Mushroom – Cost: 7₺
• Jalapeno – Cost: 4₺
Shop Name: Mama Jones’ Pizza
Pizzas:
• Aegean Pizza – Info: Tomato Sauce, Mozzarella Cheese, Olive, Red Onion, Red Pepper – Cost:
55₺
• Margherita Pizza – Info: Tomato Sauce, Mozzarella Cheese, Cherry Tomato, Basil Leaves – Cost:
58₺
• Mixed Pizza – Info: Tomato Sauce, Mozzarella Cheese, Pepperoni, Sausage, Salami, Green
Pepper – Cost: 63₺
• Barbeque Chicken Pizza – Info: Tomato Sauce, Mozzarella Cheese, Chicken Slices, Barbeque
Sauce, Jalapeno – Cost: 68₺
• Smoked Ribs Pizza – Info: Tomato Sauce, Mozzarella Cheese, Smoked Ribs, Arugula Leaves,
Parmesan Cheese – Cost: 72₺
Toppings:
• Parmesan Cheese – Cost: 5₺
• Olive – Cost: 3₺
• Ricotta Cheese – Cost: 5₺
• Sausage – Cost: 7₺
• Pepperoni – Cost: 7₺
• Salami – Cost 8₺
• Basil Leaves – Cost 7₺
• Cherry Tomato – Cost 7₺
• Jalapeno – Cost: 4₺
Your application should ask the users about their pizza orders in given order below:
1- Pizza Shop
2- Pizza Type (E.g., Smoked Ribs Pizza)
3- Topping (After each pizza selection)
Rules:
• User can order from only one pizza shop.
• User can order more than one pizza (User also can order same pizza more than ones).
• Users can add as many toppings as they want to their chosen pizzas.
After users’ orders are completed, related information about the orders should be printed out.
Expected Output Example:
———————————————————————————————————————————–
Please choose the pizza shop you want to give an order:
1. Pizza Globale
2. Pizza Hat
3. Mama Jones’ Pizza
———————————————————————————————————————————–
1. See or cancel your orders
2. Order another pizza
3. Go back to pizza shop selection
———————————————————————————————————————————–
Your orders:
Pizza Shop: Pizza Hat
Pizzas:
1.Ranch House Pizza (Tomato Sauce, Mozzarella Cheese, Salami, Mushroom, Sweet Corn, Olive)
Cost: 56₺
2.Ranch House Pizza (Tomato Sauce, Mozzarella Cheese, Salami, Mushroom)
Cost: 50₺
3.Pepperoni Pizza (Tomato Sauce, Mozzarella Cheese, Pepperoni, Jalapeno, Cherry Tomato)
Cost: 58₺
Total Number of Pizzas: 3
Total Cost: 164₺
———————————————————————————————————————————–
NOTE: You don’t have to use this exact format, but please try your best to make your software user
friendly and make sure it is expressive enough to the user. (E.g., make selections with numbers)
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_HW4
Also, the zip folder that your project in should have the same name
G05_CENG431_HW4.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.

