---
description: In this lab, we are going to solve tasks, and think as object-oriented programmers, please return to chapter 10 in your textbook if you have any questions.
---
<h1 style='border: none'><center>Programming II Lab 2</center></h1>
<h2 style='border: none'><center>Introduction to Object-Oriented Programming</center></h2>
<h5><center>The Islamic University of Gaza<br>Engineering Faculty<br>Department of Computer Engineering</center></h5>
<h6>Author: Mohammed Nafiz ALMadhoun<span style="float:right">2021/02/19</span></h6>
---
<p style='text-align:justify'>
In this lab, we are going to solve tasks, and think as object-oriented programmers, please return to chapter 10 in your textbook if you have any questions.
</p>
## Lab Tasks
### Task 1: Complete your blog!
In the previous lab, we've created a simple blog, you should complete this blog, you should add a class named `Category`, this class will hold the posts of this category, you could only list posts in a certain category, assume that each category stores its posts in a different folder.
You will have a static list of categories:
- General
- Personal
- Work
- Notes
- Java Notes
### Task 2: Simple Accounting program.
In this task, you should create a simple accounting program, in the main menu of the application you will have the following options:
```
1. Create Receipt
2. Add Item
3. Edit Item
4. Delete Item
5. Exit
```
if you entered `1`, you should allow the user to add item code and quantity, and if the user adds `0` as the code the program will print the receipt.
```
Enter Selection: 1
Enter Item Code: 100
Enter Item Qty : 2
Enter Item Code: 101
Enter Item Qty : 1
Enter Item Code: 110
Enter Item Qty : 1
Enter Item Code: 0
------------Receipt------------
ITEM NAME QTY PRICE TOTAL
Item 100 Name 2 1.00 2.00
Item 101 Name 1 5.00 5.00
Item 110 Name 1 10.00 10.00
--------
TOTAL: $17.00
```
if the user entered `2`:
```
Enter Selection: 2
Enter Item Code : 101
Enter Item Name : Item 101 Name
Enter Item Price: 1
Item saved!
```
if the user entered `3`:
```
Enter Selection: 3
Enter Item Code : 101
Enter Item New Name : (If empty leave it as it is)
Enter Item New Price: 2
Item saved!
```
if the user entered `4`:
```
Enter Selection: 3
Enter Item Code : 101
Item deleted!
```
All items should be saved in a text file `items.txt`.
Think about your program, and design your UML digram, then solve the code.
###### tags: `Programming` `Java` `IUG`
<center>End Of Lab 2</center>