You are on page 1of 28

1.

Introduction Theres a lot of bookstore in Malaysia, such as MPH, Popular, Fajar Bakti, and

Pelangi, but have we wonder is there a system of buying book exist? Have we questioned ourself is there a system in which facilitate the user to buy a book? The answer is no! As we know, nowadays there is only a bookstore which required people or user to go to the bookstore just to buy a book. This will definitely time consuming as we need to queue up at the counter futhermore if there is less number of employess in front of the counter. Next, there is book online existed which to facilitate the user to buy a desired book through online. This will certainly save the users time. However, the book online is not so practical to the user who does not have the access to internet. This will certainly beneficial to the user who have the access Internet only. How about the user who does not have the access to internet? Therefore, book online still cant solve the problem exist. Therefore, our group develop a system of buying book, namely Myawamelzis bookstore based on the combination of our group member which focussing on the process involve in the system of buying book. Our group had a clear objectives which is to facilitate the process of users buying a book, therefore it is necessary for us to use a clear instructions so that the user can easily understand. Thus, the system will help and facilitate users to buy desired book. Apart from that, the system are able to do most of the operation of adding book by admin. At the same time, the system enable the user to view the data, neither the data about book or the data about personal info that has been saved, indeed enable the user to search information about the desired book only instead of information of all book. Furthermore, the system not only benefit to the users, but as well to the admin also, in which it facilitate the process of information storage to become more systematic, methodical and orderly. The process namely as sorting.
1

2.0

Anticipated Benefits This will minimize the number of employess in the front and at the back of the counter The system will help to reduce the cost of labour. The system will be less probable to make mistake. This will avoid long queues at the counter due to the speed of execution and number of optimum screens to accommodate. The system will be available 24 hours for 365 days.

3.0

Objectives

The objectives of the project are as below: System user friendly Easier interaction between system and user

Time and cost saving To speed up the duration of transaction

Information storage and retrieval All the transactions will be recorded and saved

4.0

UML Diagram 4.1 Class Diagram

Interface MYAWAME LZI

Interface ADMINUSER

Interface ADMIN

Interface USER

ADMINUSER

BOOK

BOOKUSER

4.2

Case Diagram

ADD DATA

EDIT DATA

DELETE DATA

DISPLAY DATA

ADMIN
SEARCHING

USER

SORTING

Based on case diagram above, there are two users for this buying book system, which is admin and user (customer).

Admin The admin responsible for managing the system by updating the book in bookstore. This can be done by the process of Add Book if there are new stock, Edit Book if there are changes in details of book, and Delete Book if the stock of book is empty. Admin should key in the details of book, such as title of book, author of book, publisher of book, price of book and total number of book. Besides, admin need to update the book in bookstore so that customer knows the latest book in bookstore. It is important to make sure that the update from admin about data particular book must be linked to user (customer). Last but not least, admin should sort all the book according alphabet so that it will ease customer during the process of buy book.

User (Customer) Firstly, user need to know the title and details about book by pressing displaying book button. If the user want to search specific details about the desired book, user can press search and typing the title of book. User must be alert of all the list book in bookstore, unless the system will print out a statement of cannot find the book. Secondly, they have to fullfill the personal info of user in terms of name, title of book, total number of book to buy, address and telephone number. It is important for user to fullfill their address correctly for making the delivery of food by the admin. Then, add their correct contact number in that system for make confirmation about buying book if admin have any doubt in their ordering items. Complete the order form provided by the system which contain details about customers. When the customer decided to buy the book, they need to click buy book button, then system will print out a statement for user to make payment in Maybank.

5.0

Data Structures Used The data structure that we apply in our program which is book buying, is

contiguous list. Contiguous data structure is a method of storing data in contiguous, or adjoining, sectors of memory. We used a contiguous list in our project because this method is simple to be applied in the program as time-consuming to execute. The usage of array in our program is actually one of the characteristic of the contiguous list. In this program, we use an array to store data/ implement a program. What is an Array? An array is a special variable, which can hold more than one value at a time. Therefore array is the best data structure to hold data more than one value at time, especially when it comes to store a list of books for user to choose their requested books. All the data stored in array must be of the same type. For example, in this program, we use an array to store a list of data which is in string, double and integer type that record all the data given by the user or the administrator. Apart from that, our group choose to apply array in our program due to the need of looping through the menu of book so that user or admin given a choice of choose their option, whether they want to add data, display data, edit data or delete data or even their want to go back to the welcoming menu again to make the second choice. As a result, that was a brief reason of choosing an array for this program. This can be proven based on the figure below as we copying the source code from the file AdminUser.
//import java.util.Scanner; public class AdminUser { book BO []=new book [50]; BookUser BU[]=new BookUser[50]; String Title, Author, Publisher,Name, BookNumber, Address, TelNumber; double Price; int TotalNumber ;

Based on the source code, the size of the list is specified by users data which means the number of data insertion for AdminUser already fixed to the 50 index. Size of the list is specified by user is actually the second characteristics of contiguous list that we apply in the program. This means, if the user insert their order more than 50, so the system are unable to produces the output. The number of elements in array is called the length, size or capacity of the array. So in this context, the Title, Author, Publisher, TotalNumber, Price, Name, BookNumber, Address and TelNumber has length 50 which means it has indexed variables pressure [0] through the the Title, Author, Publisher, TotalNumber, Price, Name, BookNumber, Address and TelNumber [49]. Our group had declaire all the the Title, Author, Publisher, TotalNumber, Price, Name, BookNumber, Address and

TelNumber in file AdminUser. Title, Author, Publisher, Name, BookNumber, Address, TelNumber declaire as string data type, while Price declaire as double data type and Total Number as int data type. However, we did make a division of data, in which we divide data belongs to admin in file Book, and data belongs to user in file Book User. Each class of Book and Book User has their own array, in which there are two array that we used in this program.
public class AdminUser { book BO []=new book [50]; BookUser BU[]=new BookUser[50];

Based on the source code above, we have declaire a new name for class book as BO and a new name for class BookUser as BU in class AdminUser. This two statement is actualy shows that both BO and BU is an array, a place for storage data in which BO for admins data and BU for users data.

There are two array in our coding due we have decide the data insertion or storage for admin is in file Book [BO], while data insertion or storage for user is in file Book User [BU]. This division of array is done is due because we want to ease the process of adding and saving two different data.

public class book { String Title, Author, Publisher; double Price; int TotalNumber ;// book. public book(String a, String b, String c, double d, int e) { Title=a; Author=b; Publisher=c; Price=d; TotalNumber=e; }

Figure above shows source code from class book. Based on the source code above, book is the class for all data of admin. So, how many data and what type of data belongs to admin? There are five data in admin, which is Title, Author, Publisher, Price, and TotalNumber. Title, Author, Publisher is categorized as string data type, while price is double data type and TotalNumber is int data type. Admin responsible to add all the details or information of book in terms of its Title, Author, Publisher, Price, and TotalNumber so that user or customer can get all the details about book in Myawamelzis Bookstore. That is the reason why this five of data is categorized as data belongs to admin.

public class BookUser { String Name, TitleOfBook, BookNumber, Address, TelNumber ; // user. public BookUser(String f, String g, String h, String i, String j) { Name=f; TitleOfBook=g; BookNumber=h; Address=i; TelNumber=j; }

Figure above shows source code from class BookUser. Based on the source code above, BookUser is the class for all data of user. So, how many data and what type of data belongs to user? Contrast with admins data, there are five data in admin, which is Name, TitleOfBook, BookNumber, Address and TelNumber. All the data is string data type. In this context, user or customer needs to fullfill the order form in terms of customers name (Name), books title that customer wants to buy (TitleOfBook), quantity of book wants to buy (BookNumber), address and telephone number (TelNumber) in order to buy book. This is the reason why this five data is categorized as data belongs to user. Next, another characteristic of contiguous list is the size cant be modified, or known as static data structure. This can be proven from the figure below, as we copy from file Priority.
import java.util.Scanner; public class Priority { public static book [] BO = new book [50]; public static void main(String[] args) {

Since it is called static data structure, its has a fixed size and define the number of elements it can hold, so that the number doesnt change. The benefit of using this kind of data structure is the size of list is already known. The contigouos list is good implementation when the situations are the number of data are small and in our program, the size of data is small which up to 50 index only. Plus, contiguous list is best implement when the operations of deletion and insertion are happened rarely and when using random access. For instance, addding data of books title in array by admin. Contigous List Adding Data [0]
AyamItu Sedap

[1]
GergasiDi DuniaKini

[2]
HantuItu Jiranku

[3]
KucingDan Ayam

[4]
MataDia Bulat

[5]
Zombie Kampung Pisang

[6]..... [49]

Making room to insert MataDiaBulat as the fourth entry or index [3] in an array. [0]
AyamItu Sedap

[1]
GergasiDi DuniaKini

[2]
HantuItu Jiranku

[3]
MataDia Bulat

[4]
Zombie Kampung Pisang

[5]

[6] .....[49]

RemovingKucingDanAyam by shifting array entries. A contiguous list stores the book contiguously in the array, and the parent structures maintain the first child index and the number of children. For example, the parent structure contains children between firstChild(i) and firstChild(i) + numChildren(i) - 1 inclusive. Note that indices are zero-based. The advantage of contiguous lists is that each parent can have a variable number of children, and all the children for one parent are stored together on disk for fast access.

6.0

Searchings Technique In computer science, a search algorithm is an algorithm for finding an item with

soecified properties among a collection of items. The items may be stored individually as records in a database. Searching also refers to the operation of finding the location of a given item in a collection of items. The search is said to be successful if ITEM does appear in DATA and unsuccessful otherwise. Searching method can be divided by two ways, sequential search and binary search. As for our program, we choose to apply binary search. The main reason why we choose binary search as it suitable for the data which is already sorted either in ascending or descending order. In our program, we did arrange or sorted the data of the books according to books title alphabetically. As in our coding, the function of binary search happened when the user is being user choose button of search. In this context, once the user choose the button of search, it will display the desired book that the user want to buy, according to alphabetically by its title. This is actually showing the process of sorting which had happened in admin, and showing the process of searching in user. The admin actually had sort all the details about the book according to the alphabet by its title before the data had been linked to user. As a result, the user can easily search the title book of he/she want, thus can easily get details about the book, for instance in the context of price,publisher, author and the total number of book. The functionn of searching happen during user decide to find search book. It means, the user dont want to see all the book list, but just want to know the details about the book that he/she want to buy. Therefore, user just type the desired book that she/he looking for in the empty text field provided. Then, the user need to click the search button. Next, the information or details about the desired book according to its

author, publisher, price and total number will be print out or will be display in text area provided. Text Field and Text Area are the two terms required in designing Graphic User Interface. Without Text Field, user cant type or search the desired book, and without Text Area, the information of book cant be display. We apply binary search in this section as the title of the book is already sorted. So, how does the binary search function? The function of this source is to find the middle item,then decide whether to look in the left or in the right half. If decide to look in one half, ignore the other one half. The process are repeated until it find the target. To be compared with sequential searching, binary search can be concluded as more faster than the sequential searching. For instance, if we are looking book in our bookstore, we may decide to look from half way, as we know the book is ordered alphabetically therefore if we decide the book is in the right half, we can disregard the left half or throw it away, but we just concentrate on the right half. This way of search is dramatically reduced because we only have book to search, which means the process of searching the title of books is much faster compared to sequential search which need to compare the desired book (target) with the first entry in the list, the second entry in the list, and so on until it either locates the desired book or look all the book without success. Thus, binary search is proven more efficient than the sequential search. As in the context of best case, both binary and sequential have a value of 0(1), but in the context of worst case, binary case is more efficient which 0(log n), compared with sequential which 0(n). Same in average case, binary case is more efficient which 0(log n) compared with sequential search which 0(n).

7.0

Sortings Technique Sorting process of putting a list or a group of items in a specific order. Some

common sorting criteria are: alphabetical or numerical. Sorting can also be done in ascending order (A-Z) or descending order (Z-A). Sorting method can be actually divided into two categories, first categories is simple sort which contain insertion sort and selection sort, and the second categories is advanced sorting which contain quick sort, heap sort, shell sort and merge sort. Among this two categories, we choose to apply the simple sort in our coding which is selection sort. This simple sort is actually suitable for the program which have small data or small array. In our program,we have fixed the insertion data is only to 50 index, which can be classified as small data in the list, thus this is the main reason why our group choose to apply simple sort. Yet, however there is no doubt that advanced sorting such as shell sort, merge sort, quick sort and heap sort has advantages on speed, which this four type of sort is more faster and quick in time compared with the insertion sort or selection sort. However, this four type of sort is suitable for program which have large data or array, for instance up to hundred or thousand index.

//import java.util.Scanner; public class AdminUser { book BO []=new book [50]; BookUser BU[]=new BookUser[50]; String Title, Author, Publisher,Name, BookNumber, Address, TelNumber; double Price; int TotalNumber ;

Next, why we choose to apply selection sort, not insertion sort, as this two type of sorting is suitable for small data? Yes, both of this sorting is actually suitable for coding which have small data, for instance in our program, up to 50 index only. Plus, the insertion sort shows more efficient compared to selection sort in best case, which insertion sort is 0(n) while selection sort is 0(n2). However, as we compared this two type of sorting, the selection short shows the least number of comparison, compared to insertion sort. The figure below shows the comparison between selection sort and insertion sort during the process of sorting the book according to its alphabet. Based on the figure below, selection sort shows the least of number comparison which is 4 number of comparison, compared to insertion sort which shows more number of comparison which is 11.

(i)
ZombieKampung Pisang

Selection Sort
HantuItu Jiranku AyamItu Sedap GergasiDi DuniaKini MataDia Bulat KucingDan Ayam

1st comparison A<Z

[0]
AyamItu Sedap

[1]
HantuItu Jiranku

[2]
ZombieKampung Pisang

[3]
GergasiDi DuniaKini

[4]
MataDia Bulat

[5]
KucingDan Ayam

2nd comparison G<H

[0]
AyamItu Sedap

[1]
GergasiDi DuniaKini

[2]
ZombieKampung Pisang

[3]
HantuItu Jiranku

[4]
MataDia Bulat

[5]
KucingDan Ayam

3rd comparison H<Z

[0]
AyamItu Sedap

[1]
GergasiDi DuniaKini

[2]
HantuItu Jiranku

[3]
ZombieKampung Pisang

[4]
MataDia Bulat

[5]
KucingDan Ayam

4th comparison K<Z

[0]
AyamItu Sedap

[1]
GergasiDi DuniaKini

[2]
HantuItu Jiranku

[3]
KucingDan Ayam MataDia Bulat

[4]

[5]
ZombieKampung Pisang

No comparison M=M

[0]
AyamItu Sedap

[1]
GergasiDi DuniaKini

[2]
HantuItu Jiranku

[3]
KucingDan Ayam MataDia Bulat

[4]

[5]
ZombieKampung Pisang

No comparison Z=Z

[0]

[1]

[2]

[3]

[4]

[5]

The number of comparison for selectioon sort is 4.

(ii)
ZombieKampung Pisang

Insertion Sort
HantuItu Jiranku AyamItu Sedap GergasiDi DuniaKini MataDia Bulat KucingDan

H<Z
Ayam

[0]
HantuItu Jiranku

[1]
ZombieKampung Pisang

[2]
AyamItu Sedap

[3]
GergasiDi DuniaKini

[4]

[5]
KucingDan Ayam

MataDia Bulat

A<Z A<H

[0]
AyamItu Sedap

[1]
HantuItu Jiranku

[2]
ZombieKampung Pisang

[3]
GergasiDi DuniaKini

[4]
MataDia Bulat

[5]
KucingDan Ayam

G<Z G<H G>A

[0]
AyamItu Sedap

[1]
GergasiDi DuniaKini

[2]
HantuItu Jiranku

[3]
ZombieKampung Pisang

[4]
MataDia Bulat

[5]
KucingDan Ayam

M<Z M>H

[0]
AyamItu Sedap

[1]
GergasiDi DuniaKini

[2]
HantuItu Jiranku

[3]
MataDia Bulat

[4]
ZombieKampung Pisang

[5]
KucingDan Ayam

K<Z K<M K>H

[0]
AyamItu Sedap

[1]
GergasiDi DuniaKini

[2]
HantuItu Jiranku

[3]
KucingDan Ayam MataDia Bulat

[4]

[5]
ZombieKampung Pisang

[0]

[1]

[2]

[3]

[4]

[5]

The number of comparison for selectioon sort is 11.

So, how does the selection sort works? Selection sort are able to rearranges the object byinterchanging value. Mainly, in our program, selection short help us to sort all the title of book according to alphabet, which is the data is automatic sort. How the selection sort function? Well, the sort will locates the smallest or largest value in the array. As in our program, selection sort has rearranged the position of books title according to alphabet, lets said the title of the books start with A, its position is in the first list of array and if the title of the books start with Z, its position is in the last list of array. In this final project, the process of sorting cant be display or cant be seen in interface because once the admin add all the details about book, for instance five book in one time and the insertion data is not according to alphabet, which means perhaps the first book may begin with the letter zwhile the fifth book may begin with the letter a, it will be automatic sort according to alphabet when admin click the display button. This is difference compared with assignment 2 that required admin to choose sort the book first in order to sort the book. But have we wonder if the admin forget to click the sort button, then can the book arranged in order? The answer is no. This will became the weakness of our program. Therefore, we had modified the program so that the book added is automatic arrange in order. Thus, there will be no issues if admin forget to choose sort.

Figure : Algorithm for SelectionSort Figure shows the algorithm that we apply in this program. Selection sort are able to rearranges the object by interchanging value. Mainly, in our program, selection short help us to sort all the title of book according to alphabet. As in our program, selection sort has rearranged the position of books title according to alphabet, lets said the title of the books start with A, its position is in the first list of array and if the title of the books start with Z, its position is in the last list of array.

8.0 Graphic User Interface (Gui) In computing, graphical user interface (GUI) is a type of user interface that allows users to interact with electronic devices through graphical icons and visual indicators such as secondary notation, as opposed to text-based interfaces, typed command labels or text navigation. GUIs were introduced in reaction to the perceived steep learning curve of command-line interfaces (CLI),which require commands to be typed on the keyboard. The graphical user interface is presented (displayed) on the computer screen. It is the result of processed user input and usually the primary interface for human-machine interaction.This allows the user to select or design a different skin at will, and eases the designer's work to change the interface as the user needs evolve. Good user interface design relates to the user, not the system architecture. The goal of user interface design is to make the user's interaction as simple and efficient as possible, in terms of accomplishing user goalswhat is often called user-centered design. Good user interface design facilitates finishing the task at hand without drawing unnecessary attention to itself. Graphic design may be utilized to support its usability. The design process must balance technical functionality and visual elements (e.g., mental model) to create a system that is not only operational but also usable and adaptable to changing user needs. As in our program, we had print screen a few interface to show the flow from the first interface to the last interface.

9.0 Conclusion The proposed system is developed to manage the operations of buying book in bookstore. Its helps to add and save the desired book from user or customer. The list of book are display to inform customers about book that is provided by bookstore. This system is simple system but useful application to manage all about book. The system purposely used to improve work effectiveness and efficiency the operations of buying book in bookstore, plus delivery process as well as increase customer satisfaction.

9.2 Sample Output Figure 1 below is the first interface in our system. This visual is to give a good impression to the user. There is a next button exist, in which user or admin need to click on that to proceed to the next level or interface.

Figure 1

Figure 2 below shows second interface in which we are given three choices, whether we want to log in as admin or user or we want toexit from the system.

Figure 2

Figure 3 below show a dialog box is appear when we click the exit button.

Figure 3

Figure 4 shows an interface of admin in which there are add details button (to add details about book), resetbutton (to clear the text), display button (to display the book in which the admin had enter the details about book), edit button and delete button.

Figure 4

Figure 5 shows a dialog box are you sure you want to add the book? appeared as soon as admin click add details button.

Figure 5

Figure 6 shows a dialog box the book has been added and saved successfully to MYAWAMELZIS BOOKSTORE appeared after admin click yesto add the book, indicating the details about the book is already added.

Figure 6

Figure 7 shows the details about book in which admin had added, for example GERGASIDIDUNIAKINI has been display on the space provided. If admin to clear the text, admin can click reset.

Figure 7

Figure 8 shows a dialog box appeared are you sure you want to exit if admin click the exit button. If admin click yes, we will go back to the main page again, where we need to choose betweenadmin, user and exit.

Figure 8

Figure 9 shows an interface of user in which there are display book button(linked with book in which admin had added), search button (user search specific/desired book), add details button (add details about user), buy book button (confirmation of user to buy or not), total price button (total up the price per book) and reset button.

Figure 9

Figure 10 shows a dialog box are you sure you want to add the details? appeared as soon as user click add details button.

Figure 10

Figure 11 shows a dialog box the details has been added and saved successfully to MYAWAMELZIS BOOKSTORE appeared after admin click yesto add the book, indicating the details about the book is already added.

Figure 11

Figure 12 shows a dialog box is appeared Thank You. Please do the payment in Maybank as soon as user click the buy book button.

Figure 12