Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 128

A

PROJECT REPORT
ON

SUBMITTED TO
KURUKSHETRA UNIVERSITY
[2008-2009]

In partial fulfillment of requirements of


B.C.A. III
Under supervision of: submitted
by:
Sh. ASHWANI GUPTA ROHIT
KHURANA
H.O.D (COMPUTER SCIENCE) ROLL .NO -
8321 I.B. (P.G.) COLLEGE, PANIPAT CLASS
- B.C.A.III
UNI ROLLNO…….
CONTENTS

1. Certificate from supervisor


2. College Certificate
3. Student’s Preview
4. Preface.
5. Acknowledgement
6. Introduction
7. Objectives of Project
8. Feasibility Study
9. Platform Used
10. Project Analysis
11. Coding
12. Debugging
13. Output
14. Advantages
15 .Conclusion
16.Further scope
17. Bibliography
CERTIFICATE FROM

SUPERVISOR
This is certified that Rohit Khurana, s/o Sh. Suresh
Kumar Khurana is bonafied student of this college.

He has submitted his report on


“CYBER CAFÉ”
In partial fulfillment of his B.C.A.III degree course.

Sh. Ashwani
Gupta
H.O.D. (Computer Science)
I.B. (P.G.) College, Panipat
COLLEGE CERTIFICATE

This is certify that Mr.Rohit Khurana is a bonafied student of


B.C.A.-III. He is regular student of our college. He is submitted
his project titled “CYBER CAFE” to the partial fulfillment of the
requirement of the Kurukshetra University, Kurukshetra.

He bears a good moral character & I wish him all the success for
future life.

Dr. L.R. Madan


(Principal)
I.B. (P.G.) College, Panipat
STUDENTS PREVIEW
NAME : ROHIT KHURANA

FATHER’S NAME : SH. SURESH KUMAR KHURANA

CLASS : B.C.A.III

ROLL NO. : --------------------

COLLEGE : I.B. (P.G.) COLLEGE (PANIPAT)

PROJECT TITLE : CYBER CAFE


PREFACE
In the widening modern world, the pleasant system is facing new
challenges. Emphasis is being laid on vocationalisation of
education to cope with the hazards of unemployment and direction
loss, the natural off springs of present set up of education.

Kurukshetra University, Kurukshetra is making a determined bid


to impart computer education in order to create powerful potential
of employability; computer education has come to occupy
permanent position in the modern world. Thus it is essential to
hemp the practical field, and hence I am assigned this project,
which is a part of my subject.

This degree course aim at providing the knowledge about various


applications of computers while under going summer training we
are to prepare this project.
ROHIT KHURANA
ACKNOWLEDGEMENT

In writing this text I am indebted in many for ideas and assistance


while bearing entire responsibility for weakness in report select a
few without whose valuable help in this report would not have
been possible.

I am very grateful to Sh. Ashwani Gupta for his valuable help and
guidance.

I am also indebted to Principal, I.B. (P.G.) College who helped me


and cheered me throughout the course.

ROHIT
KHURANA
B.C.A.III
INTRODUCTION TO C++

The C programming language is a popular and widely used programming


language for creating computer programs. It was developed in AT & T’s Bell
laboratories of USA in 1972.it was design and written by DENNIS
RITCHIE. C was an offspring of the (BCPL) Basic Cambridge programming
language.
C++ is extension of C with major addition. I t was developed by BJARNE
STROUSTRUPT at AT & T’s Bell laboratories in early 1980’s.
STROUSTRUPT initially called the new languages ‘C with classes’ however
later on the name was changed C++ in 1983. The idea of C++ is comes from
increment operat or ++. C++ is superset of C.

The main characteristics of C++ language:


1. It is reliable simple and easy to use.
2. Programs written in C++ are efficient and fast. This is due variety of
data type and powerful operator.
3. C++ help in developing in structured programs
4. C++ is highly suitable for recursive programming.
5. It is also suitable for graphic programming.
6. C++ highly portable.
7. It is highly suitable for writing both system software and business
packages
OBJECTIVES OF

PROJECT
 Increased Efficiency:-
One main objective of the
proposed project is increased efficiency of manpower with
computer in various works. It does not require any creativity,
which can exhaust a man, very soon.

 Less Time Consuming:-


It is user friendly and less time
Consuming with Bottom line option.

 Reduction Of Manpower:-
It serves a lot of deskwork, as tHise
are no efforts in manipulating records.
 Degree of accuracy:-
The computerized system gives the high
degree of accuracy than manual system.

 Less use of paper work:-


In manual system a large number of
files are required but in our system paper requirement is very
less.

 Save memory:-
In computerized system we are able to save large
number of information is required.

 Modifications:-
In present system we can easily modify the
information about any transaction.

 Updating:-
With computerized system we can easily
update the system by the information.
FEASIBILITY STUDY

Before going into the details of the development process of an


information system, it is required to examine the system’s
feasibility i.e. the likelihood of the system being equally important
and beneficial for the organization. This feasibility study includes
the technical, operational and economic related aspects of the
proposed system.

Study of technical feasibility involves determining whetHis a


system can actually be constructed to solve the problem at hand. It
also deals with whetHis the proposed system will provide adequate
response to inquiries regardless of the number of users.

Operational feasibility study is much concerned with the


organizations operational requirements. Simply stated, this test of
feasibility asks if the system will work when developed and
installed. It is also concerned with major irritants but is able
enough to grow into major problem after implementation.

Political feasibility study is the most powerful type of study when


compared but is never formally included in system study
document. This study involves the extent of managerial support for
changes in the present system.
PLATFORM USED

For the completion of this project, we have worked in windows


operating system as we think everyone in the field of computers is
well versed with this great and user-friendly platform

An operating system is a collection of programs, which acts as


interface between a user and the computer hardware .It provides
the environment in which the user can easily use the computer.
Window 98 is the most common example of an operating system.

Microsoft Windows is the most popular Graphical User Interface


(GUI). It has made normal computer tasks easy for novice as well
as experts. Instead of typing commands at the command prompt in
text based operating system. MS-Window allows you to point and
click on picture in order to get the job done. Its windowing feature
allows you to run more than one program at a time. Windows 98 is
a 32-bit operating system
PROJECT ANALYSIS

Project analysis is about understanding the situations for simply


solving problems. Effective analysis tHisefore emphasizes
investigation & questioning to learn how a system currently
operates & to identify the requirements users have for a new
system or a modified one. Only after the complete understanding
of the requirement, the system design can be laid down.

The manner in which investigation is conducted will


determine weatHis the appropriate information is gatHised .In turn
having the right information influences the quality of the
application that follows. In otHis words good system design
prototyping or structured methods are begins by documenting the
current system & properly diagnosing the system requirements.

The system team examine the overall objectives of the system


then breaks it in to the sub system &finally defines the interface
between the subsystem as one system .The interface are really
that links between the component of the system. It describes the
proposed logical system in terms of components processes, data
flows and data stores .It also helps the programmer to write the
program or to develop the S/W up to great extent.
#include<iostream.h>

#include<conio.h>

#include<fstream.h>

#include<stdio.h>

#include<dos.h>

#include<string.h>

#include<process.h>

#include<graphics.h>

fstream file1,file2,file3;

class cyber

public:

char cha;

int p,k;

class info

public:

char name[20], add[30], email[20];

int noprn,noscan;
long phone;

}inf;

class tempinfo:public info

public:

int h,at_rate;

tempinfo(int x=0,int v=50)

h=x;

at_rate=v;

void tempcust()

gotoxy(22,8);

cout<<" Enter Total Hours Used Till Now : ";

cin>>h;

gotoxy(24,24);

textcolor(LIGHTGREEN+BLINK);
cout<<" Press any key to continue...";

int calc(int thrs)

int tempamount=0;

tempamount+=at_rate*thrs;

return(tempamount);

}temp;

class meminfo:public info

public:

int type,hr,wrate,mrate,yrrate;

meminfo(int w=35,int m=30,int y=25)

wrate=w;

mrate=m;

yrrate=y;
}

void member();

int calcmem(int , int);

}mem;

void input();

int search(char *naam);

int search(long);

void pro(int,int);

}cafe;

void cyber::input(void)

clrscr();

k++;

gotoxy(26,2);

cout<<" Record #";

cout<<k;

gotoxy(25,3);

cout<<" ----------";
gotoxy(22,5);

cout<<" Please Enter Your Name : ";

gets(cafe.inf.name);

gotoxy(22,7);

cout<<" Your Address Please : ";

gets(cafe.inf.add);

gotoxy(22,9);

cout<<" Your Residence Phone : ";

cin>>cafe.inf.phone;

gotoxy(22,11);

cout<<" Your Email ID (If Any) : ";

gets(cafe.inf.email);

gotoxy(18,23);

cout<<"Any Printing Or Scanning Operation(Y/N): ";

cin>>cafe.cha;

cafe.inf.noprn=0;

cafe.inf.noscan=0;

clrscr();

if(cha=='Y'||cha=='y')
{

gotoxy(22,3);

cout<<" Enter No. Of Total Printouts : ";

cin>>cafe.inf.noprn;

gotoxy(22,5);

cout<<" Enter No. Of Total Scans : ";

cin>>cafe.inf.noscan;

void cyber::pro(int ps,int expen)

p=ps-expen;

void cyber::meminfo::member()

clrscr();

gotoxy(26,2);

cout<<" Enter Member Type:";

gotoxy(25,3);
cout<<"------------------";

gotoxy(28,5);

cout<<" 1.For Weekly";

gotoxy(30,6);

cout<<" 2.For Monthly";

gotoxy(32,7);

cout<<" 3.For Yearly";

gotoxy(24,13);

cout<<"\t Enter Choice : ";

cin>>type;

switch(type)

case 1: cout<<" Enter Total Hrs Used In This Membership :


";

cin>>hr;

//memcost+=hr*wrate;

break;

case 2: cout<<" Enter total Hrs used in this membership: ";

cin>>hr;
//memcost+=hr*mrate;

break;

case 3: cout<<" Enter Total Hrs Used In This Membership:


";

cin>>hr;

//memcost+=hr*yrrate;

break;

int cyber::meminfo::calcmem(int hours,int rate)

int memcost=0;

memcost+=hours*rate;

return (memcost);

class mod

public:
int mainbill,elecbill,ispbill,printrate,scanrate,dd,yy;

char kb,code[15],choice2;

mod (int mb=100,int eb=200,int ispb=700,int p=5,int s=20)

mainbill=mb;

elecbill=eb;

ispbill=ispb;

printrate=p;

scanrate=s;

void modbill();

}md;

void mod::modbill(void)

int res=0;

// res=password();

if(res==1)

clrscr();
textcolor(MAGENTA);

gotoxy(26,2);

cout<<"Modifying Cafe Rates!";

gotoxy(26,3);

cout<<"---------------------";

gotoxy(23,6);

cout<<" Enter ISP Bill :";

cin>>ispbill;

gotoxy(23,8);

cout<<" Enter Maintenence Bill : ";

cin>>mainbill;

gotoxy(23,10);

cout<<" Enter Electricity Bill : ";

cin>>elecbill;

gotoxy(23,12);

cout<<" Enter Rate Of Printing Per Page : ";

cin>>printrate;

gotoxy(23,14);

cout<<" Enter Rate Of Scanning Per Page : ";


cin>>scanrate;

gotoxy(23,16);

cout<<" Enter Rate Of Surfing For Temporary User : ";

cin>>cafe.temp.at_rate;

gotoxy(23,20);

cout<<" Want To Change Membership Rates Also??? ";

cin>>choice2;

if(choice2=='y'||choice2=='Y')

clrscr();

gotoxy(25,2);

cout<<"Enter Weekly Rate : ";

cin>>cafe.mem.wrate;

gotoxy(25,4);

cout<<"Enter Monthly Rate : ";

cin>>cafe.mem.mrate;

gotoxy(25,6);

cout<<"Enter Yearly Rate : ";

cin>>cafe.mem.yrrate;
}

class display:public mod

char choice6;

public:

void dis();

void caferate();

}show;

void display::dis()

gotoxy(27,4);

cout<<"Name :";

puts(cafe.inf.name);

gotoxy(27,6);

cout<<"Address :";
puts(cafe.inf.add);

gotoxy(27,8);

cout<<"Phone :";

cout<<cafe.inf.phone;

gotoxy(27,10);

cout<<"Email :";

puts(cafe.inf.email);

gotoxy(27,12);

cout<<"Total Hrs Used :";

cout<<cafe.temp.h;

gotoxy(27,14);

cout<<"Total Printouts :";

cout<<cafe.inf.noprn;

gotoxy(27,16);

cout<<"Total Scannings :";

cout<<cafe.inf.noscan;

void display::caferate()

{
clrscr();

gotoxy(35,2);

cout<<" Page 2 Of 2";

gotoxy(26,2);

cout<<"Current Cyber Cafe Rates!";

gotoxy(25,3);

cout<<" -------------------------";

gotoxy(26,6);

cout<<"ISP Bill :";

cout<<ispbill;

gotoxy(26,8);

cout<<"Maintenence bill :";

cout<<mainbill;

gotoxy(26,10);

cout<<"Electricity Bill :";

cout<<elecbill;

gotoxy(26,12);

cout<<"Printing Per Page :";

cout<<printrate;
gotoxy(26,14);

cout<<"Scanning Per Page :";

cout<<scanrate;

gotoxy(26,16);

cout<<"Rate Of Surfing For Non-Members:";

cout<<cafe.temp.at_rate<<endl;

gotoxy(28,18);

cout<<"* Total Profit Is Rs.";

cout<<cafe.p;

gotoxy(23,20);

cout<<" Want To See Membership Rates Also??? ";

cin>>choice6;

if(choice6=='y'||choice6=='Y')

clrscr();

gotoxy(25,24);

cout<<" Press Any Key To View Next Page...";

getch();

gotoxy(35,2);
cout<<" Page 2 Of 2";

gotoxy(26,2);

cout<<"Current Cyber Cafe Rates!";

gotoxy(25,3);

cout<<" -------------------------";

gotoxy(25,6);

cout<<" Weekly Rate : ";

cout<<cafe.mem.wrate;

gotoxy(25,8);

cout<<" Monthly Rate : ";

cout<<cafe.mem.mrate;

gotoxy(25,10);

cout<<" Yearly Rate : ";

cout<<cafe.mem.yrrate;

//void anu();

void main()
{

clrscr();

int

trec=0,sch,exp,pos,result,o,memberamt=0,t,mrec,choice,psam=0
,temamt=0,offset,totalps=0,hit,record=0,position=0,choice3,choi
ce4,choice5,i;

char choice1,sname[20];

long sph;

do

clrscr();

file1.open("temp.sav",ios::in|ios::out|ios::ate);

if(!file1)

cout<<" Fatal Error : File Stream is inaccesible ";

break;

file1.seekg(0,ios::end);
pos=file1.tellg();

trec=0;

trec=(pos/sizeof(cyber));

file1.close();

file2.open("mem.sav",ios::in|ios::out|ios::ate);

if(!file2)

cout<<" Fatal Error : File Stream is inaccesible ";

getch();

exit(0);

file2.seekg(0,ios::end);

position=file2.tellg();

record=(position/sizeof(cyber));

file2.close();

// textcolor(12);

int gd=DETECT,gm;

initgraph(&gd,&gm,"\\tc\\bgi");

setcolor(11);
settextstyle(6,HORIZ_DIR,1);

outtextxy(1,1,"1.Temp Member :");

setcolor(12);

settextstyle(2,HORIZ_DIR,5);

// gotoxy(1,2);

// textcolor(2);

outtextxy(16,29,"Bytes Used =");

gotoxy(17,3);

cout<<pos<<endl;

outtextxy(16,44,"No Of Record = ");

gotoxy(17,4);

cout<<trec<<endl;

settextstyle(6,HORIZ_DIR,1);

// textcolor(12);

setcolor(11);

outtextxy(1,52,"2.Perma Member :");

// cout<<endl;

setcolor(12+128);
settextstyle(2,HORIZ_DIR,5);

// textcolor(128);

outtextxy(16,80,"Bytes Used = ");

gotoxy(17,6);

cout<<position<<endl;

outtextxy(16,95,"No Of Record = ");

// textcolor(BLINK);

gotoxy(17,7);

cout<<record;

/*int gdriver=DETECT,gmode;

initgraph(&gdriver,&gmode,"";

setcolor(90);

for (int w=25;w<=150;w++)

putpixel(w,65,3*w);

putpixel(w,75,2*w);

}*/

//disperse

/* int gd=DETECT,gm;
initgraph(&gd,&gm,"";

struct palettetype pal;

getpalette(&pal);

for(int i=0;i<25;i++)

setrgbpalette(pal.colors[i],i*5,i*8,i*3);

setcolor(12);

settextstyle(5,HORIZ_DIR,7);

outtextxy(200,155,"project";

outtextxy(250,215,"on";

outtextxy(140,280," cyber cafe";

for(int p=26;p>=0;p--)

for(int i=80;i<650;i++)

for(int j=190;j<450;j++)
{

int x=getpixel(i,j);

if(x<p);

int t=getpixel(i,j+1);

if(t<x)

putpixel(i,j+1,getpixel(i,j)-1);

t=getpixel(i,j-1);

if(t<x)

putpixel(i,j-1,getpixel(i,j)-1);

t=getpixel(i+1,j);

if(t<x)

putpixel(i+1,j,getpixel(i,j)-1);

t=getpixel(i-1,j);

if(t<x)

putpixel(i-1,j,getpixel(i,j)-1);
}

break;

getch();

closegraph(); */ //disperse end

setcolor(9);

settextstyle(8,HORIZ_DIR,5);

// gotoxy(30,2);

outtextxy(250,10, "MAIN MENU") ;

settextstyle(2,HORIZ_DIR,4);

// gotoxy(30,2);

// outtextxy(240,20, " Main Menu" ;

// outtextxy(250,15,"\t\t\t\t\t\t\t\t\t\t\t";
setcolor(12);

settextstyle(5,HORIZ_DIR,3);

// gotoxy(30,3);

// gotoxy(24,5);

outtextxy(250,120,"1. Add Customer.");

// gotoxy(24,6);

outtextxy(250,150, "2. Modify Customer Info.");

// gotoxy(24,7);

// anu();

outtextxy(250,180, "3. Modify Cafe Rates.");

// gotoxy(24,8);

outtextxy(250,210, "4. Delete Customer Record.");

// gotoxy(24,9);

outtextxy (250,240,"5. Display Info.");

// gotoxy(24,10);

outtextxy(250,270,"6. Search.");

// gotoxy(24,11);
outtextxy(250,300,"7. Test For Error(NOT FOR USER).");

// gotoxy(24,12);

outtextxy( 250,330,"8. Exit.");

gotoxy(60,25);

settextstyle(7,HORIZ_DIR,1);

setcolor(10);

outtextxy(275,377,"\t Enter Your Choice...");

// gotoxy(28,27);

textcolor(14);

cin>>choice;

getch();

closegraph();

switch(choice)

case 1: start:

clrscr();

cout<<" Enter Membership Type";

gotoxy(25,12);

cout<<"1.Temporary";
gotoxy(25,13);

cout<<"2.Member ";

gotoxy(28,20);

cout<<"\tEnter Your Choice: ";

cin>>t;

switch(t)

case 1: file1.open("temp.sav",ios::in|ios::out|ios::ate);

if(!file1)

cout<<" Fatal Error : File Stream is inaccesible ";

break;

cafe.k=trec;

clrscr();

gotoxy(27,9);

textcolor(GREEN);

cout<<" THise Are Currently ";

cout<<trec;
cout<<" Existing Customer Records In File. ";

gotoxy(25,10);

textcolor(RED);

cout<<" Press Any Key Now To Start Feeding Data...";

getch();

cafe.input();

trec++;

//temamt+=cafe.temp.tempcust();

cafe.temp.tempcust();

offset=((trec-1)*sizeof(cyber));

file1.seekp(offset,ios::beg);

file1.write((char*)&cafe,sizeof(cyber));

//

psam+=(cafe.inf.noprn*md.printrate)+
(cafe.inf.noscan*md.scanrate);

file1.close();

break;

case 2: file2.open("mem.sav",ios::in|ios::out|ios::ate);

if(!file2)
cout<<" Fatal Error : File Stream is inaccesible ";

cafe.k=record;

gotoxy(27,9);

textcolor(YELLOW);

cout<<" THise Are Currently ";

cout<<record;

cout<<" Existing Member Records In File. ";

gotoxy(25,10);

textcolor(YELLOW);

cout<<" Press Any Key Now To Start Feeding Data...";

getch();

cafe.input();

record++;

cafe.mem.member();

offset=((record-1)*sizeof(cyber));

file2.seekp(offset,ios::beg);

file2.write((char*)&cafe,sizeof(cyber));

//
psam+=(cafe.inf.noprn*md.printrate)+
(cafe.inf.noscan*md.scanrate);

file2.close();

break;

default:clrscr();

gotoxy(15,23);

textcolor(RED);

cout<<" Wrong Choice...";

gotoxy(23,24);

textcolor(LIGHTGREEN);

cout<<"* Press Q To Quit Or Any OtHis Key To


Continue...";

hit=getch();

if(hit=='q'||hit=='Q')

exit(0);

else

goto start;

getch();

break;
case 2: textcolor(BROWN);

gotoxy(27,2);

cout<<" Modify ";

gotoxy(27,3);

cout<<" ______ ";

gotoxy(27,5);

cout<<" 1.Temporary Customer Record";

gotoxy(27,6);

cout<<" 2.Membership Record...";

gotoxy(27,10);

cout<<"\tEnter choice...";

cin>>choice5;

if(choice5==1)

if(!trec)

clrscr();

textcolor(LIGHTBLUE+BLINK);

gotoxy(2,2);
cout<<" No Record Has Been Added Yet.";

cout<<" Please Run Option 1 First Of All";

gotoxy(24,24);

textcolor(LIGHTGREEN+BLINK);

cout<<" Press Any key to continue...";

getch();

break;

else

clrscr();

gotoxy(28,12);

cout<<"* Modify Which Record (Enter record No.)? ";

cin>>mrec;

if(mrec>trec)

textcolor(LIGHTBLUE);

gotoxy(2,2);

cout<<" Only ";


cout<<trec;

cout<<" Records Have Been Added.";

gotoxy(2,3);

cout<<" Invalid Record Number..";

gotoxy(24,24);

textcolor(LIGHTGREEN+BLINK);

cout<<" Press Any key to continue...";

getch();

break;

else

clrscr();

gotoxy(27,2);

cout<<"User Data Follows:";

gotoxy(27,3);

cout<<"-----------------";

file1.open("temp.sav",ios::in|ios::out|ios::ate);

if(!file1)
{

cout<<" Fatal Error : File Stream is inaccesible ";

break;

offset=((mrec-1)*sizeof(cyber));

file1.seekg(offset,ios::beg);

file1.read((char*)&cafe,sizeof(cyber));

show.dis();

gotoxy(29,24);

cout<<"* Modify This Record? ";

cin>>choice1;

if(choice1=='y'||choice1=='Y')

clrscr();

gotoxy(26,2);

cout<<" Enter New Details: ";

cafe.input();

file1.seekp(offset,ios::beg);

file1.write((char*)&cafe,sizeof(cyber));
gotoxy(26,12);

textcolor(GREEN+BLINK);

cout<<" Record Modified...";

gotoxy(26,24);

textcolor(LIGHTGREEN);

cout<<" Press Any key to continue...";

file1.close();

else

if(choice5==2)

if(!record)

clrscr();

textcolor(LIGHTBLUE+BLINK);

gotoxy(2,2);
cout<<" No Record Has Been Added Yet.";

cout<<" Please Run Option 1 First Of All";

gotoxy(24,24);

textcolor(LIGHTGREEN+BLINK);

cout<<" Press Any key to continue...";

getch();

break;

else

clrscr();

gotoxy(28,12);

cout<<"* Modify Which Record? ";

cin>>mrec;

if(mrec>record)

textcolor(LIGHTBLUE);

gotoxy(2,2);

cout<<" Only ";


cout<<record;

cout<<" Records Have Been Added.";

gotoxy(2,3);

cout<<" Invalid Record Number..";

gotoxy(24,24);

textcolor(LIGHTGREEN+BLINK);

cout<<" Press Any key to continue...";

getch();

break;

else

clrscr();

gotoxy(27,2);

cout<<"User Data Follows:";

gotoxy(27,3);

cout<<"-----------------";

file2.open("mem.sav",ios::in|ios::out|ios::ate);

if(!file1)
{

cout<<"Fatal Error : File Stream is inaccesible";

break;

offset=((mrec-1)*sizeof(cyber));

file2.seekg(offset,ios::beg);

file2.read((char*)&cafe,sizeof(cyber));

show.dis();

gotoxy(29,24);

cout<<"* Modify This Record? ";

cin>>choice1;

if(choice1=='y'||choice1=='Y')

clrscr();

gotoxy(26,2);

cout<<" Enter New Details: ";

cafe.input();

file2.seekp(offset,ios::beg);

file2.write((char*)&cafe,sizeof(cyber));
gotoxy(26,12);

textcolor(GREEN+BLINK);

cout<<" Record Modified...";

gotoxy(26,24);

textcolor(LIGHTGREEN);

cout<<" Press Any key to continue...";

file2.close();

getch();

break;

case 3: textcolor(YELLOW);

show.caferate();

gotoxy(28,24);

cout<<"* Modify Cafe Rates? ";

cin>>choice1;

if(choice1=='y'||choice1=='Y')
{

md.modbill();

clrscr();

gotoxy(23,12);

textcolor(GREEN+BLINK);

cout<<" Rates Modified...";

gotoxy(24,24);

textcolor(LIGHTGREEN);

cout<<" Press Any key to continue...";

getch();

break;

case 4 :

textcolor(BROWN);

gotoxy(27,2);

cout<<"Delete ";

gotoxy(27,3);

cout<<" ______ ";


gotoxy(27,5);

cout<<" 1.Temporary Customer Record";

gotoxy(27,6);

cout<<" 2.Membership Record...";

gotoxy(27,10);

cout<<"\tEnter choice...";

cin>>choice5;

if(choice5==1)

if(!trec)

clrscr();

textcolor(LIGHTBLUE+BLINK);

gotoxy(2,2);

cout<<" No Record Has Been Added Yet.";

cout<<" Please Run Option 1 First Of All";

gotoxy(24,24);

textcolor(LIGHTGREEN+BLINK);

cout<<" Press Any key to continue...";


getch();

break;

else

clrscr();

gotoxy(28,12);

cout<<"* Delete Which Record? ";

cin>>mrec;

if(mrec>trec)

textcolor(LIGHTBLUE);

gotoxy(2,2);

cout<<" Only ";

cout<<trec;

cout<<" Records Have Been Added.";

gotoxy(2,3);

cout<<" Invalid Record Number..";

gotoxy(24,24);
textcolor(LIGHTGREEN+BLINK);

cout<<" Press Any key to continue...";

getch();

break;

else

clrscr();

gotoxy(27,2);

cout<<"User Data Follows:";

gotoxy(27,3);

cout<<"-----------------";

file1.open("temp.sav",ios::in|ios::out|ios::ate);

file3.open("temp1.sav",ios::in|ios::out|ios::ate);

if(!file1)

cout<<" Fatal Error : File Stream is inaccesible ";

break;
}

offset=((mrec-1)*sizeof(cyber));

file1.seekg(offset,ios::beg);

file1.read((char*)&cafe,sizeof(cyber));

show.dis();

gotoxy(29,24);

cout<<"* Delete This Record? ";

cin>>choice1;

if(choice1=='y'||choice1=='Y')

clrscr();

file1.seekg(0,ios::beg) ;

int n =1;

while(file1.read((char *)&cafe,sizeof(cyber)))

if(mrec!=n)

offset=((n-1)*sizeof(cyber));

file3.seekp(offset,ios::beg);
file3.write((char *)&cafe,sizeof(cyber));

n++;

file1.close();

file3.close();

remove("temp.sav");

rename("temp1.sav","temp.sav");

file1.open("temp.sav", ios::in | ios::out | ios::ate);

file1.seekg(0,ios::end);

pos = file1.tellg() ;

trec=0;

trec = (pos/sizeof(cyber));

file1.close();

getch();
break;

case 5: clrscr();

textcolor(YELLOW);

gotoxy(29,2);

cout<<"Display Menu";

gotoxy(29,3);

cout<<"-------------";

gotoxy(23,5);

cout<<"1.Specific Customer Record";

gotoxy(25,6);

cout<<"2.All Customer Records";

gotoxy(27,7);

cout<<"3.Cafe Info?";

gotoxy(25,17);

cout<<"\t Enter Choice: ";

cin>>o;

switch(o)

case 1: clrscr();
gotoxy(26,2);

cout<<"Customer Type:";

gotoxy(26,3);

cout<<"---------------";

gotoxy(26,5);

cout<<"1.Temporary";

gotoxy(26,6);

cout<<"2.Member";

gotoxy(26,10);

cout<<"\t Enter Choice: ";

cin>>choice3;

switch(choice3)

case 1: clrscr();

if(!trec)

textcolor(LIGHTBLUE+BLINK);

gotoxy(2,2);

cout<<" No Record Has Been added Yet.";


cout<<" Please Run Option 1 First Of All";

gotoxy(24,24);

textcolor(LIGHTGREEN+BLINK);

cout<<" Press Any key to continue...";

getch();

break;

else

gotoxy(24,12);

cout<<" Display which record# ? ";

cin>>mrec;

if(mrec>trec)

clrscr();

textcolor(CYAN+BLINK);

gotoxy(2,2);

cout<<" Only ";

cout<<trec;
cout<<" Records Have Been Added.";

gotoxy(2,3);

cout<<" Invalid Record Number...";

gotoxy(24,24);

textcolor(LIGHTGREEN+BLINK);

cout<<" Press Any key to continue...";

cout<<endl;

getch();

break;

else

file1.open("temp.sav",ios::in|ios::out|ios::ate);

if(!file1)

cout<<"Fatal Error : File Stream isinaccesible ";

break;

clrscr();
gotoxy(23,1);

cout<<"User Data Follows For Record #";

cout<<mrec;

gotoxy(23,2);

cout<<"---------------------------------";

offset=((mrec-1)*sizeof(cyber));

file1.seekg(offset,ios::beg);

file1.read((char*)&cafe,sizeof(cyber));

show.dis();

gotoxy(24,24);

textcolor(LIGHTGREEN+BLINK);

cout<<" Press Any key to continue...:";

getch();

textcolor(GREEN+BLINK);

file1.close();

break;

case 2: clrscr();
if(record==0)

textcolor(LIGHTBLUE+BLINK);

gotoxy(2,2);

cout<<" No Record Has Been added Yet.";

cout<<" Please Run Option 1 First Of All";

gotoxy(24,24);

textcolor(LIGHTGREEN+BLINK);

cout<<" Press Any key to continue...";

getch();

break;

else

gotoxy(24,12);

cout<<" Display which record# ? ";

cin>>mrec;

if(mrec>record)

{
clrscr();

textcolor(CYAN+BLINK);

gotoxy(2,2);

cout<<" Only ";

cout<<record;

cout<<" Records Have Been Added.";

gotoxy(2,3);

cout<<" Invalid Record Number...";

gotoxy(24,24);

textcolor(LIGHTGREEN+BLINK);

cout<<" Press Any key to continue...";

cout<<endl;

getch();

break;

else

file2.open("mem.sav",ios::in|ios::out|ios::ate);

if(!file2)
{

cout<<"Fatal Error : File Stream is inaccesible ";

break;

clrscr();

gotoxy(23,1);

cout<<"User Data Follows For Record #";

cout<<mrec;

gotoxy(23,2);

cout<<"---------------------------------";

offset=((mrec-1)*sizeof(cyber));

file2.seekg(offset,ios::beg);

file2.read((char*)&cafe,sizeof(cyber));

show.dis();

gotoxy(24,24);

file2.close();

textcolor(LIGHTGREEN+BLINK);

cout<<" Press Any key to continue...:";

getch();
textcolor(BROWN);

break;

default:gotoxy(26,24);

textcolor(YELLOW);

cout<<"Wrong Choice!!!";

getch();

break;

break;

case 2: clrscr();

gotoxy(26,2);

cout<<"Customer Type:";

gotoxy(26,3);

cout<<"---------------";

gotoxy(26,5);

cout<<"1.Temporary";

gotoxy(26,6);
cout<<"2.Member";

gotoxy(26,10);

cout<<"\t Enter Choice: ";

cin>>choice4;

switch(choice4)

case 1: if(!trec)

textcolor(LIGHTBLUE+BLINK);

cout<<" No Record Has Been added Yet.";

cout<<" Please Run Option 1 First Of All";

gotoxy(24,24);

textcolor(LIGHTGREEN+BLINK);

cout<<" Press Any key to continue...";

getch();

break;

else

{
file1.open("temp.sav",ios::in|ios::out|ios::ate);

if(!file1)

cout<<"Fatal Error : File Stream is inaccesible";

break;

file1.close();

for(int i=0;i<trec;i++)

clrscr();

file1.open("temp.sav",ios::in|ios::out|ios::ate);

textcolor(MAGENTA);

gotoxy(28,2);

cout<<" Record #";

cout<<i+1;

cout<<" Follows:";

gotoxy(28,3);

cout<<" ------------------";

offset= i * sizeof(cyber);
file1.seekg(offset,ios::beg);

file1.read((char*)&cafe,sizeof(cyber));

show.dis();

gotoxy(24,24);

textcolor(LIGHTGREEN);

cout<<" Press Any Key To See Next Record...";

textcolor(RED);

getch();

file1.close();

break;

case 2: if(!record)

textcolor(LIGHTBLUE+BLINK);

cout<<" No Record Has Been added Yet.";

cout<<" Please Run Option 1 First Of All";

gotoxy(24,24);

textcolor(LIGHTGREEN+BLINK);
cout<<" Press Any key to continue...";

getch();

break;

else

file2.open("mem.sav",ios::in|ios::out|ios::ate);

if(!file2)

cout<<"Fatal Error : File Stream is inaccesible";

break;

file2.close();

for(int i=0;i<record;i++)

clrscr();

file2.open("mem.sav",ios::in|ios::out|ios::ate);

textcolor(MAGENTA);

gotoxy(28,2);
cout<<" Record #";

cout<<i+1;

cout<<" Follows:";

gotoxy(28,3);

cout<<" ------------------";

offset=i*sizeof(cyber);

file2.seekg(offset,ios::beg);

file2.read((char*)&cafe,sizeof(cyber));

show.dis();

gotoxy(24,24);

textcolor(LIGHTGREEN+BLINK);

cout<<" Press Any Key To See Next Record...";

textcolor(YELLOW);

getch();

file2.close();

break;

}
getch();

break;

case 3: textcolor(MAGENTA);

file1.open("temp.sav",ios::in|ios::out|ios::ate);

if(!file1)

cout<<" Fatal Error : File Stream is inaccesible ";

file1.seekg(0,ios::beg);

for(i=0;i<trec;i++)

offset=(i*sizeof(cyber));

file1.seekg(offset,ios::beg);

file1.read((char*)&cafe,sizeof(cyber));

psam+=(cafe.inf.noprn*md.printrate)+
(cafe.inf.noscan*md.scanrate);

temamt+=cafe.temp.calc(cafe.temp.h);

file1.close();

file2.open("temp.sav",ios::in|ios::out|ios::ate);

if(!file2)
cout<<" Fatal Error : File Stream is inaccesible ";

file2.seekg(0,ios::beg);

for(i=0;i<trec;i++)

offset=(i*sizeof(cyber));

file2.seekg(offset,ios::beg);

file2.read((char*)&cafe,sizeof(cyber));

psam+=(cafe.inf.noprn*md.printrate)+
(cafe.inf.noscan*md.scanrate);

memberamt+=cafe.mem.calcmem(cafe.mem.hr,cafe.mem.wrate
);

file2.close();

exp=md.mainbill+md.elecbill+md.ispbill;

totalps=temamt+psam+memberamt;

cafe.pro(totalps,exp);

show.caferate();

getch();
break;

default:textcolor(GREEN+BLINK);

cout<<" Wrong Choice!!!";

getch();

textcolor(GREEN);

break;

break;

case 6: textcolor(BLUE);

if(!trec)

textcolor(BLUE+BLINK);

cout<<" No Record Has Been Added Yet.";

cout<<" Please Run Option 1 First Of All";

gotoxy(24,24);

textcolor(LIGHTGREEN+BLINK);

cout<<" Press any key to continue...";

getch();

break;
}

else

anubhav:

clrscr();

gotoxy(26,2);

cout<<" Search By:";

gotoxy(29,3);

cout<<"1.Name";

gotoxy(32,4);

cout<<"2.Phone...";

gotoxy(35,5);

cout<<"\t Enter Choice...";

cin>>sch;

if(sch!=1&&sch!=2)

goto anubhav ;

else

if(sch==1)

{
clrscr();

cout<<"* Enter Search Name: ";

gets(sname);

result=cafe.search(sname);

clrscr();

cout<<"result is :";

cout<<result;

if(result==0)

gotoxy(10,23);

cout<<" No Such Name Exist!";

gotoxy(24,24);

textcolor(LIGHTGREEN+BLINK);

cout<<" Press any key to continue...";

getch();

break;

else

{
textcolor(LIGHTGREEN+BLINK);

gotoxy(26,13);

cout<<" Search Successful! Customer Name: ";

puts(sname);

cout<<" Found!";

gotoxy(26,24);

textcolor(MAGENTA);

cout<<" Press A Key To View The Record...";

getch();

clrscr();

cout<<" User Data Follows:";

cout<<"-------------------";

offset=((result-1)*sizeof(cyber));

file1.seekg(offset,ios::beg);

file1.read((char*)&cafe,sizeof(cyber));

show.dis();

gotoxy(24,24);

textcolor(LIGHTGREEN+BLINK);

cout<<" Press any key to continue...";


getch();

break;

else

if(sch==2)

cout<<"* Enter Search Phone# ";

cin>>sph;

result=cafe.search(sph);

cout<<"result is :";

cout<<result;

getch();

clrscr();

if(result==0)

textcolor(LIGHTMAGENTA+BLINK);

cout<<" No Such Phone Number Exist...";

gotoxy(24,2);
textcolor(LIGHTGREEN+BLINK);

cout<<" Press any key to continue...";

getch();

textcolor(GREEN);

break;

else

textcolor(LIGHTGREEN+BLINK);

gotoxy(26,13);

cout<<" Search Successful! Customer Phone#: ";

cout<<sph;

cout<<" Found!";

gotoxy(26,24);

textcolor(RED);

cout<<" Press A Key To View The Record...";

getch();

clrscr();

cout<<" User Data Follows:";


cout<<"-------------------";

offset=((result-1)*sizeof(cyber));

file1.seekg(offset,ios::beg);

file1.read((char*)&cafe,sizeof(cyber));

show.dis();

getch();

textcolor(LIGHTRED);

break;

getch();

break;

case 7: textcolor(LIGHTGRAY);

cout<<"totalps";

cout<<totalps<<"
exp:"<<exp<<"memberamt:"<<memberamt;

cout<<endl<<"hrs :"<<cafe.temp.h/*<<"

tempamount:"<<cafe.tempamount*/<<endl<<" p:"<<cafe.p;
cout<<"pscamt:";

cout<<psam<<"total prints:"<<cafe.inf.noprn<<"total
scans:"<<cafe.inf.noscan<<endl<<"***These lines are for
testing purpose only!***";

getch();

break;

case 8: //textcolor(BLUE);

textcolor(YELLOW+BLINK);

exit(0);

/* cout<<"PRESS 'CTRL+PAUSE' TO QUIT AFTER


THE END OF

MESSAGE";

getch();

int gd=DETECT,gm;

initgraph(&gd,&gm,"";

struct palettetype pal;

getpalette(&pal);

for(int i=0;i<25;i++)

setrgbpalette(pal.colors[i],i*5,i*8,i*3);
}

setcolor(7);

settextstyle(5,HORIZ_DIR,7);

textcolor(RED);

// cout<<"PRESS CTRL+PAUSE TO QUIT";

outtextxy(100,155,"hope you enjoyed";

outtextxy(120,205,"working in this";

outtextxy(150,255," cyber cafe";

for(int p=36;p>=0;p--)

for(int i=50;i<650;i++)

for(int j=190;j<450;j++)

int x=getpixel(i,j);

if(x<p);

{
int t=getpixel(i,j+1);

if(t<x)

putpixel(i,j+1,getpixel(i,j)-1);

t=getpixel(i,j-1);

if(t<x)

putpixel(i,j-1,getpixel(i,j)-1);

t=getpixel(i+1,j);

if(t<x)

putpixel(i+1,j,getpixel(i,j)-1);

t=getpixel(i-1,j);

if(t<x)

putpixel(i-1,j,getpixel(i,j)-1);

exit(0);

closegraph();*/
break;

case 9 :textcolor(MAGENTA);

//exit();

break;

default :textcolor(BROWN+BLINK);

cout<<" Wrong Choice...";

getch();

// break;

}while(choice>=1&&choice<=8);

gotoxy(24,24);

textcolor(LIGHTGREEN+BLINK);

cout<<" Press any key to continue...";

textcolor(BLUE);

getch();

int cyber::search(long tel)

{
int n=0,e,pos1,g;

file1.open("temp.sav",ios::in|ios::out|ios::ate);

if(!file1)

cout<<" Fatal Error : File Stream is inaccesible ";

file1.seekg(0,ios::end);

pos1=file1.tellg();

g=(pos1/sizeof(cyber));

// file1.seekg(0,ios::beg);

while(n<g)

e=(n*sizeof(cyber));

n++;

file1.seekg(e,ios::beg);

file1.read((char*)&cafe,sizeof(cyber));

if(inf.phone==tel)

file1.close();

return (n);
}

file1.close();

n=0;

e=0;

file2.open("mem.sav",ios::in|ios::out|ios::ate);

if(!file2)

cout<<" Fatal Error : File Stream is inaccesible ";

file2.seekg(0,ios::end);

pos1=file2.tellg();

g=(pos1/sizeof(cyber));

while(n<g)

e=(n*sizeof(cyber));

file2.seekg(e,ios::beg);

file2.read((char*)&cafe,sizeof(cyber));

n++;

if(inf.phone==tel)

{
file2.close();

return n;

file2.close();

getch();

return 0;

int cyber::search(char *naam)

int g,pos2;

file1.open("temp.sav",ios::in|ios::out|ios::ate);

if(!file1)

cout<<" Fatal Error : File Stream is inaccesible ";

file1.seekg(0,ios::end);

pos2=file1.tellg();

g=(pos2/sizeof(cyber));

file1.seekg(0,ios::beg);

int ctr=0;
while(ctr<g)

file1.seekg(ctr*sizeof(cyber),ios::beg);

file1.read((char*)&cafe,sizeof(cyber));

ctr++;

if(strcmpi(cafe.inf.name,naam)==0)

file1.close();

return (ctr);

file1.close();

file2.open("mem.sav",ios::in|ios::out|ios::ate);

if(!file2)

cout<<" Fatal Error : File Stream is inaccesible ";

file2.seekg(0,ios::end);

pos2=file1.tellg();

g=(pos2/sizeof(cyber));

file2.seekg(0,ios::beg);
ctr=0;

while(ctr<g)

file2.seekg(ctr*sizeof(cyber),ios::beg);

file2.read((char*)&cafe,sizeof(cyber));

ctr++;

if(strcmpi(cafe.inf.name,naam)==0)

file2.close();

return (ctr);

file2.close();

return 0;

}
DEBUGGING
Debugging is the process of isolating and correcting
the cause of known errors. The following steps were used
during debugging process :

 The information about the observed failure and known


facts about concerned successful test cases was collected.
 The system like when did the error occur, under what
condition did it occur and how does the failure cases
differ from the successful ones were observed.
 The patterns were examined and the information for the
conditions that differentiate the failure case from the
successful one was collected.
 Corrections were made based on evaluation of various
hypotheses.
 The backtracking procedure was also brought into use,
which involves working backward in the source code
from the point wHise the error was observed in an
attempt to point wHise the error occurred.
 
      Enter Membership Type

1.Temporary
2.Member

○Enter Your Choice: 1


There Are Currently 1 Existing Customer Records In File.

Press Any Key Now To Start Feeding Data...


Record #2
----------

Please Enter Your Name : ashish

Your Address Please : pnp

Your Residence Phone : 234444

Your Email ID (If Any) : kumarashish@yahoo.com

Any Printing or Scanning Operation(Y/N): N


Modify
______

1. Temporary Customer Record


2. Membership Record...

○Enter choice...1
User Data Follows:
-----------------
Name : vinay

Address : PnP

Phone : 222222

Email : w2

Total Hrs Used: 2

Total Printouts: 0

Total Scanning: 0

* Modify This Record? Y

                                                                         
                                                                                
                                                                                
           
 

Enter No. Of Total Printouts : 21

Enter No. Of Total Scans :1

Record Modified...

Press Any Key To Continue...       


      
Current Cyber Cafe Rates!
-------------------------

ISP Bill : 700

Maintenance bill : 100

Electricity Bill : 200

Printing Per Page : 5

Scanning Per Page : 20

Rate Of Surfing For Non-Members:50

* Total Profit Is Rs.1000

Want To See Membership Rates Also??? Y


Current Cyber Cafe Rates!
-------------------------

Weekly Rate : 35

Monthly Rate : 30

Yearly Rate : 25

Pr* Modify Cafe Rates? t Page...  


    
Delete
______

1. Temporary Customer Record


2. Membership Record...

○Enter choice...2
Display Menu
-------------

1. Specific Customer Record


2. All Customer Records
3. Cafe Info?

○ Enter Choice: 1
User Data Follows For Record #2
---------------------------------

Please Enter Your Name : ashish

Your Address Please : pnp

Your Residence Phone : 234444

Your Email ID (If Any) : kumarashish@yahoo.com

Total Hrs Used : 30

Total printouts :0

Total Scanning :0

Press Any Key To Continue…:


Current Cyber Cafe Rates!
-------------------------

ISP Bill : 700

Maintenance bill : 100

Electricity Bill : 200

Printing Per Page : 5

Scanning Per Page :20

Rate Of Surfing For Non-Members:50

* Total Profit Is Rs.850

Want To See Membership Rates Also???


Search By:
1. Name
2. Phone...
○ Enter Choice...
* Enter Search Name: ashish

           Result is: 2

Search Successful! Customer Name: ashish


Found!

Press Any Key To View The Record... 


    User Data Follows: -------------------

Name : ashish

Address : PnP

Phone : 234444

Email : kumarashish

Total Hrs Used: 2

Total Printouts: 21

Total Scanning: 1

Press Any Key To Continue...


    Totalps1850 exp: 1000memberant:0
Hrs: 30
p:0pscamt:250total prints:0total scans:0
***These lines are for testing purpose only! ***
ADVANTAGES

Increase your Cyber cafe profit


Tight control of your employees, POS system that bills additional
services, accept credit cards and offer automatic payment and
signup. Various reports provide instant access to statistics, current
stock. Save your time, money and effort!

Improve security
Once installed, your computers will be safe and protected. Limit
access to windows desktop, drives, configure browser or run in
Hell for maximum protection.

Customer satisfaction
Fully customizable, tailored to customer needs. Offers stored
profiles and save games

Free updates, excellent tech support


Constant improvement led us to Version 6 that includes many
customer requests, new features, new look
CONCLUSION
In practical work on this project I have felt that the computer
system applied on the telephone “CYBER CAFE” has clear
advantage over manual system. By it, process has become more
efficient and reliable.

The software used in the project work is “C++” which proves to


be more useful and efficient in data handling. It has many
commands and facilities, which make more demands over this
software’s and languages.
FURTHER SCOPE

The Scope Of this Project is not restricted to only for a


unique field organization or an industry. It can be used in
small as well as big organization of any kind where
predefined system on which project is based behaves in
same manner.
BIBLIOGRAPHY
BOOK ‘s NAME WRITER’s NAME
1. Programming With C++ Sushil Goel
2. Introduction to C++ Balaguruswami
3. Let’ s C++ Yashwant kanikar

You might also like