Vous êtes sur la page 1sur 37

Table of Contents

1. 2. 3. 4. 5. Introduction ................................................................................................................................... 2 Problem Definition ........................................................................................................................ 3 Scope .............................................................................................................................................. 4 Aim & Objectives ........................................................................................................................... 5 Program Design ............................................................................................................................. 6 5.1 Input, Process & Output................................................................................................................ 7 5.1.1 Input ....................................................................................................................................... 7 5.1.2 Process ................................................................................................................................... 7 5.1.3 Output .................................................................................................................................... 7 6. Program Documentation .............................................................................................................. 9 Implementation of the Object-Oriented Concept .............................................................................. 9 a) b) c) Queue....................................................................................... Error! Bookmark not defined. Linear-Searching....................................................................... Error! Bookmark not defined. ADT List .................................................................................... Error! Bookmark not defined.

Description of Class ........................................................................................................................... 10 7. 8. 9. 10. 11. 12. Class Diagram & Inheritance ...................................................................................................... 12 User Manuals with Screenshots ................................................................................................. 13 Program Limitation ..................................................................................................................... 16 Work Distribution ................................................................................................................... 17 Conclusions .............................................................................................................................. 18 Source Code ............................................................................................................................. 19

Submission Slip.................................................................................................................................... 37

1. Introduction
This project introduces Bookstore Management System. It explains how booking services are being done in Bookstore Management System, by delivering important functions to the end user. This project is developed in C/C++language. Proper comments have been given at desired locations to make the project user friendly and understandable. Various functions and structures are used to make a complete use of this language.Thus project is well versed with the programming. This program helps a lot to those Bookstore Management Unit that have to keep large collection of book in a constant monitoring.This program allow Bookstore Management Unit to efficiently manages books stock in their inventory a nutshell, the Bookstore Management System could have increased the efficiency of books inverntory management.

2. Problem Definition
Our situation is, we have a vast collection of book which really need the proper management system.Few attributes such as current stock and safety stock vales of the book should be traced easily by typing book title. As stated in the assignment guideline, we have to make a Bookstore Management System. We have created a system for books management for those who are tasked to manage books inventory. In out newly created system, there are attributes included, the intention for this attributes is for user ease of use. The, detail of the book title can be traced by admin in few seconds which is really convenience and user-friendly.

The definition of the problem lies in the manual system and a fully automated system. Manual system: The system is very time consuming and lazy. This system is more prone to errors and sometimes the approach to various problems is unstructured. Computerized system: With the advent of latest technology, if user does not update the system then the business results in losses gradually with time. That somehow pressured programmer to code computer system that will make the rental process become more efficient, reliable, fast, proper recording and user friendly. Need of Bookstore Management System: a. Faster system b. Accuracy c. Reliability d. Informative e. User Friendly

3. Scope
This document covers the entire system and all its subparts. The purpose of this system is as follows: Efficiency: This system provides quick addition, deletion or search for various types of data which are a part of the system. This decreases the process time for employees and manual search work that could take hours can be done in just a few seconds or minutes. Accurate records: There is no fear of manipulation of records by unauthorized personnel. All records stored in the system are protected. Files in storage may catch fire or be spoilt in water. But data storage in repositories reduces those risks. Accountability: Any records made through the system are kept track of and in case anything goes wrong with customer dealings, the fault can be traced back to the origin very easily. User Friendly: A system that is easy to learn, pleasant looking graphical user interface (GUI) and easy to use by all types of audience.

4. Aim & Objectives


The aim of the project is to design and construct a program to ease the process of managing books using computerized system. The objective of the program is: a. b. c. d. Able to display the current stock and others of the book in inventory Able to display the books information. Able to modify or delete the data Able to save data to a file

5. Program Design
To build this system we use vector library, string library and fstream library. This library used is to make coding efficient yet simple to understand by implementing the used of vectors and strings. Fstream in the other hand used to provide an interface to read and write data from files as input/output streams. Classes were used to distribute work of the system in few parts. This is because, to make the coding run as fast and efficient as possible, all the class should work together without any error. By using class we can combine the class to other class by using link list. This system has only 1 administrator, the admin is the one that will deal with the books. Admin has the ability to add or delete any books that were ordered by customers. In other hand, admin can also put many waiting customer in a simple, organized waiting list. The system also applies hierarchy method, which it will go to next option after the top level task is finished. In the final stage of the system, it can show all the the book information and other details. .

5.1 Input, Process & Output 5.1.1 Input


In order to utilize the program, the user has to input the selection of functions, whether to: i. ii. iii. iv. v. vi. vii. View the books store information Search books by title Add new book title Edit existing books record Delete old books information View all books registered in the system Exit

5.1.2 Process
The program will record the all process data in (.txt) file The program continues repeating to accept other bookings.

5.1.3 Output
The user could display i. ii. iii. View Current Stock Values View Safety Stock Value View Waiting List for selected books

Here is the example of Input, Process & Output of registering book store information done by admin

Input

Prompt the admin to enter a. b. c. d. Book title Current Stock Values Safety Stock Values Waiting List

Process

The program record the process

Output

Display Output a. b. c. d. Book title Current Stock Values Safety Stock Values Waiting List

6. Program Documentation
Implementation of the Object-Oriented Concept
a) ADT List Prompt the user to enter a data to search in the List. If the data is in the list display the message Data Found! If not, display the message Data Not Found!

b) Linked List

Our program also used Linked list to make the data management more systematic, based on its features.

And here is the screenshots of how it is implemented in the program.

Description of Class
The class are explained in simple manner and are sorted by the exact sequence in the source code

Class & Functions class Administrator string getID () string getPassword() void setID() Void setPassword() class List Class StoreInfo void activityPageAdmin() void addBook() void checkAdminPage() String getpass(const char *prompt,bool show_asterisk=true) void line1(),void line2() void loadAll() void loginPage() void int main() void name() void saveAll()

Description To allow some function to be used by admin To read admin ID To read admins password To write Admins ID To write admins password ADT vector class for List ADT vector class for store info To display admin option To add the book into the system Admin login page To read admin password and validate it Graphical representation of Main page To retrieve data from saved files To display admin further option Main function of Bookstore Management System To display our team members To save input into file(.txt)
10

Class & Functions void edit_member() void tableInfo() void ViewInfo()

Description To edit the data in the (MEMBER.DAT) file Display book information in the store To retrieve information key in by admin

11

7. Class Diagram & Inheritance

12

8. User Manuals with Screenshots


General view

These are the front view of the program. It neatly displays the name of the program Bookstore Center. Admin need to key in their ID and password to enable them to get admin privilage

13

Administrator

These are all the privileges functions that can be utilized by administrator.

Admin enters the first option, to show all the information that had been stored previously, information include current stock value of the books, safety stock and waiting list.

This is the second option which is adding books by admin. Admin will be asked to key in 1) Book title 2) Book Type 3) Current Stock Value

14

4) Waiting List order.

This is the fourth option of our program, which enable admin to update book information such as current stock values etc. As we can see, admin have to key in book ID which will initiate searching process of the book.

15

9. Program Limitation
To be frank, there are some problems in the book management system that we design which are: a. Book title cannot include space b. Our system have a narrow range of function

16

10. Work Distribution


These are the workload distribution or allocation that been passed to every each team members in the group.

MUHD SHAKIR

TASK

FAIZ BIN KAMARUDDIN

AZIHANAFI BIN MOHD DAKIR

DZULJALILIKRAM

ZUFAYRI BIN MUSTAFAR

Analysis and Information Research

Coding and Programming

Progress Report

System Testing and Debugging

Final Report

Presentation and Demonstration


17

11. Conclusions
This development of the program has reflected our efforts to re-create and re-implement an existing Bookstore Management System, to hasten updates and easier for admin to manage books using computer system. Aside from that our main aim is to provide quality, reliability and innovative solutions towards users especially to administrator to use computerized system, we hope this program will make the book management process become more efficient than previous system. We will provides more elements or more facilities if there are other requests from the users to make sure this program will give 100% satisfaction to the users. In conclusion our Book Management System will continue to be improvised for audience ease of use.

18

12. Source Code


This is the C++ coding that been used and implemented in making the program. Certain functions are highlighted with comments to issue the uses of the code.

#include <iostream> #include <fstream> #include <iomanip> #include "ListP.cpp" #include "ListException.h" #include "ListIndexOutOfRangeException.h" #include <stdio.h> #include <stdlib.h> #include <string> #include <sstream> #include <windows.h> #include<conio.h>

using namespace std;

ofstream database; ifstream i_database;

List AdminID, AdminPword; List BookID,BookName, BookInfo, CurStock, SafetyStock, WaitingList; List OrderID, CustName, CustPhone; 19

class Administrator { protected: string ID, Password;

public: void setID(){ cout<<"Enter ID : "; getline(cin, ID); cin.clear(); cin.ignore(); }

string getID(){ return ID; }

void setPassword(){ cout<<"Enter Password : "; getline(cin, Password); cin.clear(); cin.ignore(); }

string getPassword(){ return Password; }

20

}; class StoreInfo : virtual public Administrator{

private: string BookID, BookName, CurStock, SafetyStock, WaitingList ; static int count;

public:

void setBookID(){

if(count<10) BookID="0"+count;

else if(count>9 && count<100) BookID="000"+count; cout<<BookID;

string

getBookID(){

return BookID; }

void

addCount(){ 21

count++; setBookID(); }

static int getCount(){ return count; }

void setNameBuku(){ cout<<"Enter Book Title : "; cin >> BookName; }

string getBookName(){ return BookName; }

void setCurStock(){ cout<<"Enter Current Stock : "; cin >> CurStock; }

string getCurStock(){ return CurStock; }

22

void setSafetyStock(){ cout<<"Enter Safety Stock: "; cin >> SafetyStock; }

string getSafetyStock(){ return SafetyStock; }

void setWaitingList(){ cout<<"Enter Waiting List : "; cin >> WaitingList; } string getWaitingList(){ return WaitingList;}

};

string getpass(const char*, bool); void loadAll(); void loginPage(); void saveAll(); void checkAdminPage(); void activityPageAdmin(string);

void line1(); void line2(); 23

void name(); void line1(){

cout<<"=========================================================================== ====="<<endl; } void name(){ cout<<" cout<<" cout<<" cout<<" cout<<" cout<<" ---------------------------------- "<<endl; Group Member "<<endl; : Faiz Kamaruddin"<<endl; : Dzuljalalil Ikram"<<endl; : Azihanfi Mohd Dakir"<<endl; : Muhammad Shakir "<<endl;

cout<<" } void line2(){

---------------------------------- "<<endl;

cout<<"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++"<<endl; } void tableInfo(); void tableInfo(){ cout<<"=========================================================================== ====="<<endl; cout<<"Book ID | Book Name | Current Stock | Safety Stock | Waiting List Stock "<<endl;

cout<<"=========================================================================== ====="<<endl;

24

int main(){ loadAll(); loginPage(); saveAll();

return 0; }

void loadAll(){// load file

AdminID.load("AdminID"); AdminPword.load("AdminPword"); //------------------------BookID.load("BookID"); //BookInfo.load("BookInfo"); CurStock.load("CurStock"); SafetyStock.load("SafetyStock"); WaitingList.load("WaitingList"); //---------------------OrderID.load("OrderID"); CustName.load("CustName"); CustPhone.load("CustPhone"); //-------------------------

ListItemType temp; 25

i_database.open("BookInfo.txt"); for( int i = 0; i <= BookInfo.getLength(); i++ ) { getline(i_database,temp); if(temp=="") break; // BookInfo.insert(BookInfo.getLength() + 1, temp); BookInfo.retrieve(BookInfo.getLength()+1,temp); } i_database.close();

} void saveAll(){// save file

AdminID.save("AdminID"); AdminPword.save("AdminPword"); //------------------------BookID.save("BookID"); // BookInfo.save("BookInfo"); CurStock.save("CurStock"); SafetyStock.save("SafetyStock"); WaitingList.save("WaitingList"); //---------------------26

OrderID.save("OrderID"); CustName.save("CustName"); CustPhone.save("CustPhone"); //-------------------------

string name;

database.open("BookInfo.txt"); for( int i = 1; i <= BookInfo.getLength(); i++ ) { // BookInfo.retrieve( i, name ); BookName.insert(i,name); database<<name<<endl; } database.close(); }

void loginPage(){ line1(); cout<<endl; line2(); cout<<" line2(); name(); cout<<endl<<endl<<endl; 27 BOOKSTORE CENTER"<<endl;

cout<<"

1. ADMIN"<<endl<<endl;

int choice;

do{// check input cout<<"Enter choice : "; cin>>choice; if(cin.fail()){ cout << "Not a number " << endl; cin.clear(); cin.ignore(); } else if(choice<1 || choice>2){ cout<< "Wrong Input"<<endl; } else{ break; } }while(!cin.fail() || choice <1 || choice > 2); cin.ignore(); switch(choice){ case 1: system("cls");checkAdminPage();break; // case 2: system("cls");checkMemberPage();break; default: cout<<"Error Input"<<endl;break; } system("pause"); system("cls"); 28

void ViewInfo(); void ViewInfo(){ StoreInfo a;

cout<<endl; line1(); cout<<" line1(); cout<<endl<<endl<<endl; ListItemType bid,n, cs,ss,wl; line1(); cout<<"NO | Book name line1(); for( int i = 1; i <= BookID.getLength(); i++ ) {// view booking BookID.retrieve(i, bid); BookInfo.retrieve(i, n ); CurStock.retrieve(i, cs ); SafetyStock.retrieve(i, ss); WaitingList.retrieve(i, wl); \t | currrent stock | safety stock | waiting list \t"<<endl; BOOK STORE INFORMATION"<<endl;

cout<<"|" <<setw(0)<<i<<" |" // <<setw(12)<<bid<<"|" <<setw(20)<<n<<" |" 29

<<setw(5)<<cs<<" |" <<setw(5)<<ss<<" |" <<setw(5)<<wl<<" |"<<endl; } system("pause"); system("cls"); }

void addBook(); void addBook(){ StoreInfo a;

cout<<endl; line2(); cout<<" line2(); cout<<endl<<endl<<endl; if(BookID.getLength()<50){ a.getBookID(); a.setNameBuku(); a.setCurStock(); a.setSafetyStock(); a.setWaitingList(); Book Record"<<endl;

BookID.insert(BookID.getLength() + 30

1, a.getBookID());

BookInfo.insert(BookInfo.getLength() + 1, a.getBookName()); CurStock.insert(CurStock.getLength() + 1, a.getCurStock()); SafetyStock.insert(SafetyStock.getLength()+1, a.getSafetyStock()); WaitingList.insert(WaitingList.getLength()+1,a.getWaitingList()); } else{ cout<<"full !! "<<endl; cout<<"max"<<endl; } system("pause"); system("cls"); }

string getpass(const char *prompt, bool show_asterisk=true) { const char BACKSPACE=8; const char RETURN=13;

string password; unsigned char ch=0;

cout <<prompt;

while((ch=getch())!=RETURN) { 31

if(ch==BACKSPACE) { if(password.length()!=0) { if(show_asterisk) cout <<"\b \b"; password.resize(password.length()-1); } } else if(ch==0 || ch==224) // handle escape sequences { getch(); // ignore non printable chars continue; } else { password+=ch; if(show_asterisk) cout <<'*'; } }

return password; } void checkAdminPage(){

cout<<endl; 32

cout<<" name();

ADMIN SECURE SITE"<<endl;

cout<<endl<<endl<<endl; string q ="a"; string w ="a";

AdminID.insert(AdminID.getLength()+1, q); AdminPword.insert(AdminPword.getLength()+1, w); string id13, password13; cout<<"ID cin>>id13; : ";

string mid13, pswrd13; int z=2; password13=getpass("PASSWORD : ",true); for( int i = 1; i <= AdminPword.getLength(); i++ ) {

AdminID.retrieve(i,mid13); AdminPword.retrieve(i,pswrd13); if(id13==mid13 && password13==pswrd13){ z = 1;

} else{ z = 2;} } 33

switch(z){ case 1: system("cls"); activityPageAdmin(id13); break; case 2: system("cls");cout<<"Wrong ID or Password"<<endl;system("pause");system("cls");loginPage();break; default: cout<<"Error Input"<<endl;break; }

system("pause"); system("cls"); }

void activityPageAdmin(string admin){ line2(); cout<<endl; line1(); cout<<" name(); cout<<endl<<endl<<endl; line2(); MENU PAGE"<<endl;

cout<<" cout<<" cout<<" cout<<" line2();

1. Store Information"<<endl; 2. add buku"<<endl; 3. Save"<<endl; 4. EXit"<<endl; 34

int choice;

do{ cout<<"Enter choice : "; cin>>choice; if(cin.fail()){ cout << "Not a number " << endl; cin.clear(); cin.ignore(); } else if(choice<1 || choice>17){ cout<< "Wrong Input"<<endl; } else{ break; } }while(!cin.fail() || choice <1 || choice > 17); cin.ignore(); switch(choice){ case 1: system("cls");ViewInfo();activityPageAdmin(admin);break; case 2: system("cls");addBook();activityPageAdmin(admin);break; case 3: system("cls");saveAll();activityPageAdmin(admin);break; case 4: system("cls");saveAll();exit(0);break;

35

default: cout<<"Error Input"<<endl; system("pause"); system("cls"); activityPageAdmin(admin);break; } }

36

Submission Slip

37

Vous aimerez peut-être aussi