0% found this document useful (0 votes)
57 views

Computer Science Investigatory Project

This document describes a computer science project on developing a book shop management system. The project uses C++ and includes functions for staff and customers. Staff can create, display, add, modify the item menu. Customers can view items, purchase items by entering item code and quantity, and view bills. The objectives are to automate book purchasing, maintain stock records, and make the process easier for buyers, sellers and the book company.

Uploaded by

you tube
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views

Computer Science Investigatory Project

This document describes a computer science project on developing a book shop management system. The project uses C++ and includes functions for staff and customers. Staff can create, display, add, modify the item menu. Customers can view items, purchase items by entering item code and quantity, and view bills. The objectives are to automate book purchasing, maintain stock records, and make the process easier for buyers, sellers and the book company.

Uploaded by

you tube
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 22

COMPUTER SCIENCE

PROJECT FILE ON THE TOPIC:

“BOOK SHOP”

PEEYUSH YADAV
XII-D
Registration No: ………………….
TABLE OF CONTENTS
 Certificate
 Acknowledgement
 Header files and their purpose
 Coding
 Output
 Objective
 Requirements
 Brief description
 Bibliography
CERTIFICATE
This is to certify that PEEYUSH YADAV of class
XII-D has successfully completed his Computer
science project on the topic:
“BOOK SHOP”

Signature of Teacher:

Signature of Examiner:

Date …………………...
ACKNOWLEDGEMENT

I owe a great thanks to many people who have helped


and supported me during this project.

I express my gratitude and thank Mrs. Kiran Kumari


my school Computer Science teacher, for extending her
support during the completion of the project.
Header files and their purpose

1.FSTREAM.H – for file handling, cin and cout

2.CONIO.H – for clrscr() and getch()functions

3.STDIO.H – for gets() function

4.STRING.H – for strcpy() and strcmpi()

5.CTYPE.H – for character handling

6.MATH.H- for pow() function


CODING
#include<fstream.h>
#include<conio.h>
#include<ctype.h>
#include<string.h>
#include<math.h>
#include<stdio.h>
//creating function prototype
void staff();
void customer();
void bill();
void create();
void display();
void append();
void modify();
void total();

//creating class item


class item
{
public:
int icode;
char iname[80];
int iprice;
//creating function input() to take the details from the user
void input()
{
cout<<"Enter the code of the item: "<<endl;
cin>>icode;
cout<<"Enter the name of the item: "<<endl;
gets(iname);
cout<<"Enter the price of the item: "<<endl;
cin>>iprice;
}

//creating function output() to display the details as entered by the user


void output()
{
cout<<"The item code is: "<<icode<<endl;
cout<<"The item name is: "<<iname<<endl;
cout<<"The item price is: "<<iprice<<endl<<endl;
}

//creating function retname() to return name


char*retname()
{
return iname;
}

//creating function retcode() to return code


int retcode()
{
return icode;
}

//creating function retprice() to return iprice


int retprice()
{
return iprice;
}
}; //end of class item

//creating class product


class product
{
public:
float price;
int code;
char name[80];
int qty;
long tot;

//creating function getdata() to get details of the items to be purchased


void getdata()
{
cout<<"Enter the item code to be purchased: "<<endl;
cin>>code;
cout<<"Enter the quantity of item to be purchased: "<<endl;
cin>>qty;
cout<<endl;
}

//creating function total() to calculate the total


void total()
{
tot=((qty)*(price));
}

//creating function retotal() to retotal


float retotal()
{
return tot;
}

//creating function showdata() to display the details of the item purchased


void showdata()
{
cout<<"The code of the purchased item is: "<<code<<endl;
cout<<"The name of the purchased item is: "<<name<<endl;
cout<<"The quantity iof the purchased item is: "<<qty<<endl;
cout<<"The price of the purchased item is: "<<price<<endl;
}
}; //end of class product
//function for entering into the program
void intro()
{
clrscr();
int ch;
do
{
cout<<"................ book shop ..............."<<endl;
cout<<"……….. …………."<<endl;
cout<<"_________________________________________________________"<<endl;
cout<<"_______________________________________________________ __"<<endl;
cout<<endl<<endl;
cout<<"YOU WANT TO ENTER AS "<<endl;
cout<<"1. STAFF"<<endl;
cout<<"2. CUSTOMER"<<endl;
cout<<"3. EXIT"<<endl;
cout<<"Enter your choice"<<endl;
cin>>ch;
switch(ch)
{
case 1:staff();
break;
case 2:customer();
break;
case 3:break;
}
} while(ch!=3);
}

//creating function staff() for staff use only


void staff()
{
clrscr();
int ch;
do
{
cout<<"WHICH OPERATION DO YOU WANT TO PERFORM ?" <<endl<<endl;
cout<<" 1. Create the menu" <<endl;
cout<<" 2. Display the menu"<<endl;
cout<<" 3. Add new record in the menu"<<endl;
cout<<" 4. Modify a record"<<endl;
cout<<" 5. Go to the menu"<<endl;
cout<<"Enter your choice"<<endl;
cin>>ch;
switch(ch)
{
case 1:create();
break;
case 2:display();
break;
case 3:append();
break;
case 4:modify();
break;
case 5:break;
}
} while(ch!=5);
}

//creating function create() to write the records


void create()
{
clrscr();
fstream fil;
char ch;
item s;
fil.open("ITEM.DAT",ios::out|ios::binary);
do
{
s.input();
fil.write((char*)&s,sizeof (s));
cout<<"Do you want to enter more records?(y/n)"<<endl;
cin>>ch;
cout<<endl;
}
while(ch=='y'||ch=='Y');
fil.close();
}

//creating function display() to display the records


void display()
{
clrscr();
item s;
fstream fil;
fil.open("ITEM.DAT",ios::in|ios::binary);
while(fil.read((char*)&s,sizeof s))
{
s.output();
}
fil.close();
}

//creating function append() to append record


void append()
{
clrscr();
item s;
char ch;
fstream fil;
fil.open("ITEM.DAT",ios::app|ios::binary);
do
{
s.input();
fil.write((char*)&s,sizeof s);
cout<<"Do you want to append more records?"<<endl;
cin>>ch;
}while(ch=='y'||ch=='Y');
fil.close();
}

//creating function modify() to modify a record


void modify()
{
clrscr();
int code;
item s;
fstream fil;
cout<<"Enter the code of the item to be modified:"<<endl;
cin>>code;
fil.open("ITEM.DAT",ios::in|ios::out|ios::binary);
while(fil.read((char*)&s,sizeof s))
{
if (s.retcode()==code)
{
fil.seekp(fil.tellg()-sizeof(s),ios::beg);
s.input();
fil.write((char*)&s,sizeof(s));
}
}
fil.close();
}

//creating function customer()


void customer()
{
clrscr();
long gtot=0;
display();
char ch;
product s;
fstream fil,ifil;
item a;
fil.open("cust.dat",ios::out|ios::binary);
do
{
s.getdata();
ifil.open("ITEM.DAT",ios::in|ios::binary);
while(ifil.read((char*)&a,sizeof (a)))
{
if(a.retcode()==s.code)
{
s.price=a.retprice();
strcpy(s.name,a.retname());
s.total();
fil.write((char*)&s,sizeof (s));
}
}
gtot+=(s.retotal());
cout<<"Do you want to continue purchasing?(y/n)"<<endl;
cin>>ch;
ifil.close();
}while(ch=='y'||ch=='Y');
fil.close();
fil.open("cust.dat",ios::in|ios::binary);
cout<<endl;
cout<<"$$$$$$$$$$$$$$$$ BILL $$$$$$$$$$$$$$$$$"<<endl;
cout<<endl;
cout<<"your bill goes as............"<<endl;
while(fil.read((char*)&s,sizeof (s)))
{
s.showdata();
cout<<endl;
}
cout<<endl;
cout<<"GRAND TOTAL Rs."<<gtot<<endl;
cout<<endl;
cout<<"===============THANKS FOR VISITING==============="<<endl;
}

//creating function main()


void main()
{
intro();
}
OBJECTIVE:
Aim of this project is to make purchasing of books
online. In traditional purchasing of books it is difficult
to keep record of available books for selling books to a
customer. So the purpose of this purchasing of books is
to make the work of buyer, seller and company books
easier by keeping record of available books of different
subjects & authors and provide details of the books to
customers in a quick manner. This website also
provides facility to the user for maintaining and
managing stock of books. Customer can buy books of
their choice and by card. This website also allow user to
write feedback about the various books so that other
user knows about the feedback of the book. The
company can view the dispatch details of various order
booked by various users.
REQUIREMENTS:

1) HARDWARE REQUIREMENT:
a) Ram: 512 MB or greater
b) CPU: 2 GHZ or greater
c) Hard-disk Space: 40 GB or greater

2) SOFTWARE REQUIREMENT:
TECHNOLOGY
c++
DATABASE
SQL Server 2005
BRIEF DESCRIPTION:

This project automates the traditional purchasing of


books. Since in traditional purchasing of books, it is
difficult to keep record of available books for sale and
purchase with the customer, this project makes
purchasing of books online by reserving books for
customer online which automatically keeps track of
available books for each book.
There are basically two types of users that can be
created-

1. Administrator – This user has access to add a new


book, view/ update/delete an existing book, book a
book for a customer and view an existing customer
order status. This user can also add book detail,
update/delete book and also handle order of a customer
online.
2. User( Customer) – This user has limited access to
the system. This type of user mainly includes users who
can perform all operations except the Admin specific
operations. User’s most commonly performed action is
to book a book and also sell his old book set at a best
price online. Along with this, user can view/update
customer details.

Whenever any user logs into the system, system


identifies the role of the user. Based on the role home
page is displayed to the user which contains all the links
for the actions that the user has access to.
Hence, this application speeds up the working of
purchasing of books by its efficient way of reserving
books and keeping track of various necessary book
records online.
OUTPUT
BIBLIOGRAPHY

 www.google.com

 www.wikipedia.com

 www.icbse.com

You might also like