Professional Documents
Culture Documents
2.1.Software Usage
This program runs to show menu and want user to choose user’s choice.
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.
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.
Programe will be end when user choice “E” else programe will show menu.
2.3.Error Messages
Show Menu
Get choice
Run choosen
Show Menu until user choice “E”
3.1.2.Solution
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.
MainClass
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(System.in);
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.
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)
{
this.name=name;
this.author=author;
this.isbn=isbn;
bookCount++;
}
When user add a new book , bookcount will raise.
3.2.Main Data Structe
SYSTEM
Book
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