You are on page 1of 9


Computer Science and Engineering Department


2008/2009 SPRING

➢ Name and Surname Muhammet GUNEY

➢ Identity Number 20521487
➢ Course Bil 137
➢ Experiment 1
➢ Subject Inheritance, Access Modifiers Usage
➢ Submission Date 13.03.2009
➢ Due Date 20.03.2009
➢ Advisors Dr. Ebru Sezer, R.A. Önder Keskin
➢ e-mail
➢ Platform /Editor WINDOWS Vista / Eclipse
➢ Main Program
1. Software Catologue Information

Programmer Muhammet GÜNEY

Programming Language Java
Operating System Windows Vista
Main Program

2. Software Using Documentation

2.1.Software Usage

This program runs to show menu and want user to choose user’s choice.

User can use “A , R, S, L, C, E” to choose what user want to do.

✔ If choice is ‘A’ , Program will run “Add a new book” .

Program ask user to give ISBN , name of Book , name of Author .

✔ İf choice is ‘L’ , Program will run “List” .

Program will list . List will be ordered by use name of book.

For example if user give followings items , program will list them like
*(LİST Window)

Program will put in order each entry by use name of book


✔ İf choice is ‘S’ , Program will run “Search for a book” .

Program will ask user to give string .After , will look entry is exist or
not.İf there is
a record ,show other attributes else entry not found.

✔ İf choice is ‘R’ , Program will run “Removing a book”

Firstly, User enter isbn number of the book and then book details (name,
author) will be
printed. After that program will ask the user to confirm deletion.

✔ İf choice is “C‘’ , Program will run “Book Count”

Write how much book are there on list.

2.2. Provided Possibilities

Programe will be end when user choice “E” else programe will show menu.

2.3.Error Messages

1.Wrong Choice---- Error! Try again pleas...

2.Same ISBN ---- This entry added before
3.No found name--- Entry not found

3. Software Design Notes

3.1. Desctiption of the program
Staff of book ıtem need a program to compile .User will get command to which operations
will do.program will perform followings items.

Show Menu
Get choice
Run choosen
Show Menu until user choice “E”

My programe have 4 class. (MainClass,Menu,Book,Functions) This
classes will be helpful to solve this problem. We will use object oriented
to call class methods. Program
will start with MainClass thats have main metods.

have 1 method
public static void main(String [] args )

main method
create a object to call menu class’s method
Menu menu = nev Menu();
Menu class
Have menu method and it will show menu until user choice “E”.
Create a object to call Functions Class’s methods

Functions class
private Scanner sc = new Scanner(;
private Book book[]=new Book[100];

Add method
Get ISBN,nameof book , name of author from user and save
them by use
book object.before save , look ISBN is added before. For this , use
controlISBN method.

Remove method
Get ISBN from user to control for exist or not. İf there is a enty
ask user to delete or not. İfuser get “yes” , delete it.

This method will use removeEntry method to delete.

searchName method
Get string from user and search this string at name of book.İf
there is string at name of book , write it to show user.
I used to String.matches(string) for find string.

orderList method
ı kept name of boks at a String array and ı used
Arrays.sort(String array[]) to order .

count method
show how much are there at system.

Book class
private int isbn;//to object
private String name;//to object
private String author;//to object
public static int bookCount=0;//keep to count of boks // TO CLASS
we will keep specialies of books at here.
I hava a constructor.
public Book(String name ,String author ,int isbn)
When user add a new book , bookcount will raise.
3.2.Main Data Structe

This figure is basicly explaning the project

1. Start with main method at MainClass
1.1.Create new Menu name of the “menu”
1.2.Run menu
1.2.1.Show menu
1.2.2.Run menu.choice to get choice
1.2.3.Create new Functions name of the “fc”
1.2.4.İf choice is “A” ,”a” , run fc.add ısbn ısbnİf ısbn isnt exist , get name and author to add new Bookname of the “book” to add new book
1.2.5.İf choice is “R” ,”r” , run fc.remove ISBN to control it with fc.controlISBNİf there is a entry , show name and author user to delte entry or notİf user get “yes” , remove entry by use
1.2.6.İf choice is “S” ,”s” , run fc.searchName string name to match string by use
string.match(string)İf there is a entry or more , show all at window
1.2.7.İf choice is “L” ,”l” , run fc.orderList a string array and fill in it with name of book
,author ,ISBN array by use Arrays.sort(array[]) array[]
1.2.8.İf choice is “C” ,”c” , run count by use Book.bookCount
1.2.9.İf choice is “E” ,”e” “Thanks you to use this programe”
1.2.10.else “Error message!!” and show menu again

private int isbn;//to object
private String name;//to object
private String author;//to object
public static int bookCount=0;//keep to count of books

public Book(String name ,String author ,int isbn)


public void setIsbn(int isbn) {

this.isbn = isbn;

public void setName(String name) { = name;

public void setAuthor(String author) { = author;

public int getIsbn() {

return isbn;

public String getName() {

return name;

public String getAuthor() {

return author;