SlideShare a Scribd company logo
C++ project
C++ project
INTRODUCTION TO C++
“Language shapes the way we think and determines what we can think about”
C++ is one of the latest, dynamic and powerful environments for programming. C++ was
developed by Bjarne Stroustrup in the Bell laboratories in the early 1980’s. This section
reveals some of the features and advantages of c++.
Two languages contributed to its design-C, which provided low level features and simula
67,which provided the class concept.
C++ is an example of an object-oriented language. Other OOP language includes Smalltalk
and Ada.
EVOLUTION OF THE NAME C++
Rick Mascitti coined the name c++ in the summer of 1983. The name signifies the
evolutionary nature of the change from C. “++” is an increment operator. The slightly
shorter name C+ is the syntax error. Connoisseurs ofC semantics find C++ inferior to ++C.
The language is not called D, because it is an extension of C and does not attempt to remedy
problems by removing features.
SOME OF THE FEATURES OF C++
The reason for the popularity of C++ can by easily understood by its obvious features.
i) POWER AND FLEXIBILITY
C++ is an highly flexible, versatile and the very powerful programming language
for developing any software especially the system software namely operating
systems, compilers, editors, databases.
ii) MAINTAINABILITYAND REUSABILITY
C++ is most ideally suited for development of reusable software, that is, a
software which can be used for wide variety of problems with no little change.
This results in cost reduction of software development.
iii) PORTABILITY
C++ is machine independent, this means that a software development for a
particular computer system can be used on other computers with no or little
change.
iv) RELIABILITYREGULARITYAND READABILITY
C++ is reliable, regular and provides a lot of facilities for the simple codes to be
made reliable. Its efficiency is very high, making it every programmers favorite
environment.
WHY C++ IS CALLED A MIDDLE LEVEL LANGUAGE:
C++ is called a middle level language, not because its standard is lower than high level
languages, but due to the fact that it combines the best features of assemble language and
those of high level languages.
C and C++ posses the efficiency of low level languages and the user – friendliness of high
level languages so instead of calling it a middle level language, C++ can be more
appropriately called a hybrid programming language.
HOW C++ IN IMPROVEMENT OVER C?
C++ is officially known as superset of the C language. C++ retains all of C’s strength
interface its low level system programming, and its efficiency, economy and powerful
expressions.
In addition to these inherited features C++ introduces the dynamic world of object
programming and creates a platform for high level program abstraction. C++ accomplishes
all this with a simplicity and support for modularity while maintaining the compactness
and execution ifficiency of C. Due to these reasons the increment operator is addes to the
original name C thus making the new enhanced version, C++.
BASE OF C++
The C language has itself evolved partly under the influence of the development of C++.
The ANSI C standard contains function dexlaration syntax borrowed from “C with classes”.
Borrowing works both ways for example, the void * pointer type was invented for ANSI C
and first implemented in C++. C++ lays emphasis on modularity, strongly typed interfaces
and flexibility.
A SHORT NOTE ON OOP FACILITY OF C++
C++ has introduced object oriented programming to the world. C++ treats data and
operation that can be performed on the data as an object and an object is treated as a class.
So when a software is developed for a class rather than for individual data items, the
software developed for the class is applicable to all the objects in the class. This results in
the development of reusable software.
PURPOSE OF C++
The C++ programming language is designed to
 Be a better C
 Support data abstraction
 Support OOP features Viz
 Data hiding
 Encapsulation
 Inheritance
 Polymorphism
 Objects and Classes
SYSTEM CONFIGURATION
HARDWARE
 Microprocessor chip – Intel Pentium IV
 Speed 2 GHz
 RAM capacity 2 giga Byte
 Hard Disk Drive 500 Giga Byte
 Keyboard – 104 keys
 Color Monitor – Samtron -15”
 Mouse – Logitech
 Printer – canon ink Jet
SOFTWARE
 MSDOS – Version 6.22
 Windows 2007 ultimate
 C++ version 3.0
 Ms Word 2013
ABOUT THE PROJECT
This project mainly concentrates on online booking of tickets for the
movies. This C++ program uses concepts like classes, data files
handiling and makeup the whole program’s using switch cases. It
allows the user to search for the movie by entering the movie name,
enable to view the list of all movies running in the theatre. This also
allows the user to book tickets for the movie he prefers. This
program will be easily accessible by the management staff of the
theatre to insert or delete movie from the theatre. This provides a
great help for both the staff and the user to maintain and preserve
their records.
Thus the project has been designed in such a fashion that even a
common man understands it and can operate it. Thus it’s simplicity
and wide utility has directed me to choose this project in this era of
entertainment.
DOCUMENTATION
This program is been compiled by using Borland turbo C++ v 8.0.
The working of the program is quite simple. It starts off by displaying a
men8 as given below.
1.Searching
2.Booking
3.Insertion
4.Deletion
5.About
6.Exit
 When the user chooses option 1:
The program directs the user to a screen where 3 options
are displayed showing the user , which are, search by movie
name , view list of all movies or to return ot main menu.
When the user chooses option:-
1.The program asks the user to enter the movie name to be
searched. The program will now search the file for the
details of the movie. If the movie name in the file matches
the name entered by the user then the corresponding
details will be displayed.
2.The program displays all the names of the movie present
in the file.
3.The program directs the user to the main menu.
When the entered option does not match in any file it
displays “Movie not found” and returns to the main menu.
 When the user chooses option 2:
The program directs the user to the screen where it asks the
user to enter the movie name for which he wants to book a
ticket. If the name of the movie entered matches with the
movies available.
When the entered option does not match any in file it
displays “Wrong option” and returns to the main menu.
 When the user chooses option 3 :
This option directs him to a screen where it asks him to
enter the password for insertion of records. Then it asks for
movie name, screen number , movie type and ticket cost
and movie capacity. After entering it asks whether do you
want to insert more records. When the password entered is
wrong it shows a message “Wrong password” and directs
him to the main menu.
 When the user chooses option 4:
The program directs the user to the screen where it asks him
to enter password for deletion of records. Then it asks for
the movie name to be deleted. Then it deletes the movie
and shows the option the movie has been deleted. Do you
want to delete more records. If the entered password is
wrong it shows a message “Wrong password” and directs
him to the main menu.
 When the user chooses option 5:
The program directs the user to a screen where 3 options
are displayed showing the user , which are about the
program, about the programmers, return to the main menu.
When the user enters option:-
1.It displays details about the program and how the program
is executed.
2.It displays details about the programmers.
3.The program directs him to the main menu.
 When the user chooses option 6:
The program exits and shows a message “ENJOY(‘-‘)”
followed by “BYEEE….”. This statement shows that the user
is going to exit from the program.
HEADER FILES USED AND THEIR PURPOSE
FSTREAM.H – for file handling, cin and cout
CONIO.H – for clrscr() and getch() functions
STDIO.H – for standard I/O operations
DOS.H – for execution of program
STRING.H – for string handling
TIME.H – for time and local time functions
LABLES USED:-
This program makes use of certain number of labels. They are :
 a:
 s:
 h:
 m:
With the help of ‘goto’ function, the program will be directed to the
respective label.
Class cinema:-
This class stores the essential details of the movies running in
the theatre. They variables stored in the program to store these details
are :-
Private members:-
 screenno
 mov_type
 cost
Public members:-
 mov_name
 cap
The class also has 2 public member functions namely:-
 get_data()
 put_data()
void main():-
This function reads the number from the user as to operate on
which operation is to be carried out. Then it is switched to the
respective operation such as searching, booking, insertion, deletion and
exiting.
Variables used for manipulating are as shown below:-
INTEGER VARIABLES:-
 dd
 mm
 yy
 choice[0]
 choice[1]
 i
 n
 k
 z
 j
 rnum
CHARACTER VARIABLES:-
 mov
 f
 nam
 ch
 cha
 ans
 pas
 p
 an
 pa
 secret
 name
 found
 confirm
 s
C++ project
Coding:
#include<fstream.h>
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
#include<dos.h>
#include<time.h>
class cinema
{
int screenno;
char mov_type;
int cost;
public:
char mov_name[20];
int cap;
void get_data();
void put_data();
}
f1,temp;
void cinema::get_data()
{
cout<<"tt Enter the movie's name:";
gets(mov_name);
cout<<"tt Enter the screen number:";
cin>>screenno;
cout<<"tt Enter the movie's type:";
cin>>mov_type;
cout<<"tt Enter the movie's cost:";
cin>>cost;
cout<<"tt Enter the movie's capacity:";
cin>>cap;
}
void cinema::put_data()
{
cout<<"tt DETAILS OF THE MOVIE ARE-:n"
<<"tt --------------------------n";
cout<<"tt Movie Name:";
puts(mov_name);
cout<<"tt Movie code:"<<screenno<<endl;
cout<<"tt Movie type:"<<mov_type<<endl;
cout<<"tt Movie cost:"<<cost<<endl;
cout<<"tt Movie capacity:"<<cap<<endl;
}
void main()
{
clrscr();
struct date d;
getdate(&d);
int dd,mm,yy;
dd=1*d.da_day;
mm=1*d.da_mon;
yy=1*d.da_year;
int choice[2];
gotoxy(20,20);
cout<<"Welcome to the world of unlimited entertainment!!!!!"
<<"nntt Press Enter to continue";
getch();
a:
clrscr();
gotoxy(25,10);
cout<<dd<<'-'<<mm<<'-'<<yy;
gotoxy(15,15);
cout<<"Enter-:"
<<"nnttt 1.Searching"
<<"nnttt 2.Booking"
<<"nnttt 3.Insertion"
<<"nnttt 4.Deletion"
<<"nnttt 5.About the Programmers"
<<"nnttt 6.Exit nn"
<<"ttt Enter your choice:";
cin>>choice[0];
switch(choice[0])
{
case 1:
clrscr();
gotoxy(25,10);
cout<<dd<<'-'<<mm<<'-'<<yy;
gotoxy(15,15);
cout<<"1.Search by movie namenntt"
<<"2.View list of all moviesnntt"
<<"3.Go Backnntt Enter your choice:";
cin>>choice[1];
switch(choice[1])
{
case 1:
clrscr();
gotoxy(25,10);
cout<<dd<<'-'<<mm<<'-'<<yy;
ifstream fi("theatre1.dat",ios::in );
gotoxy(15,15);
cout<<"ntt Enter the name of the movie";
char mov[20],f='n';
gets(mov);
cout<<"n";
while(!fi.eof())
{
fi.read((char*)&f1,sizeof(f1));
if(!strcmpi(f1.mov_name,mov))
{
clrscr();
gotoxy(25,10);
cout<<dd<<'-'<<mm<<'-'<<yy;
gotoxy(20,20);
f1.put_data();
getch();
f='y';
break;
}
}
if(f=='n')
{
clrscr();
gotoxy(25,15);
cout<<dd<<":"<<mm<<":"<<yy;
gotoxy(15,10);
cout<<"nttMovie not found!!!!!";
}
fi.close();
getch();
goto a;
case 2:
clrscr();
gotoxy(25,10);
cout<<dd<<'-'<<mm<<'-'<<yy;
ifstream aa("theatre1.dat",ios::in);
gotoxy(15,12);
cout<<"ntt THE LIST OF THE MOVIES ARE-:n";
int i=1;
while(!aa.eof())
{
aa.read((char*)&f1,sizeof(f1));
cout<<"ntt"<<i<<".";
puts(f1.mov_name);
if(i%10==0)
{
cout<<"ntt Press Enter to Continue";
getch();
clrscr();
gotoxy(25,10);
cout<<dd<<'-'<<mm<<'-'<<yy;
gotoxy(15,15);
}
i++;
}
getch();
aa.close();
goto a;
case 3:
goto a;
default:
clrscr();
gotoxy(25,10);
cout<<dd<<'-'<<mm<<'-'<<yy;
gotoxy(15,15);
cout<<"tt You have enter a WRONG OPTION!!!n"
<<"tt Do you want to start again ? (Y/N):";
char ch;
cin>>ch;
clrscr();
if((ch=='y')||(ch=='Y'))
goto a;
break;
}
break;
case 2:
s:
clrscr();
gotoxy(25,10);
cout<<dd<<'-'<<mm<<'-'<<yy;
int rnum;
fstream fi;
fi.open("theatre1.dat",ios::out|ios::in);
ofstream fo;
fo.open("temp1.dat",ios::out|ios::app);
gotoxy(5,15);
cout<<"ntt Enter the name of the movie"
<<"for which you want to buy tickets";
char nam[20],cha='f';
gets(nam);
cout<<"nntt Enter the number of tickets"
<<"u want to buy:";
int n;
cin>>n;
while(!fi.eof())
{
fi.read((char*)&f1,sizeof(f1));
if(!strcmpi(nam,f1.mov_name))
{
f1.cap-=n;
fo.write((char*)&f1,sizeof(f1));
cha='t';
}
else
fo.write((char*)&f1,sizeof(f1));
}
if(cha=='f')
cout<<"ntt MOVIE NOT FOUNDn";
else
{
cout<<"nnttt TICKETS BOOKED";
cout<<"nnttt Your ID:";
cout<<((rnum=rand()%100)+15);
cout<<"nnttta Enjoy athis amoviea";
cout<<"nnttt Show this ID to get ur ticket";
}
remove("theatre1.dat");
rename("temp1.dat","theatre1.dat");
cout<<"nnntt Do you want to"
<<"buy more tickets?(y/n):";
char ans;
cin>>ans;
if(ans=='y')
goto s;
goto a;
case 3:
clrscr();
char pass[]="MOVIE",p[6],an='y';
int k;
gotoxy(25,10);
cout<<dd<<'-'<<mm<<'-'<<yy;
gotoxy(15,15);
cout<<"tt Enter the password!!!nttttt";
for (k=0;k<5;k++)
{
p[k]=getch();
cout<<"*";
}
getch();
if(!strcmp(pass,p))
{
clrscr();
getch();
ofstream fin;
fin.open("theatre1.dat",ios::out|ios::app);
while(an=='y')
{
clrscr();
gotoxy(25,10);
cout<<dd<<'-'<<mm<<'-'<<yy;
gotoxy(15,15);
cout<<"ttt INSERTION"
<<"ntttt-----"
<<"nntt Enter The Details:"
<<"nnn";
f1.get_data();
fin.write((char*)&f1,sizeof(f1));
clrscr();
gotoxy(25,10);
cout<<dd<<'-'<<mm<<'-'<<yy;
gotoxy(15,20);
cout<<"nnttRecord added to file"
<<"nttWant to enter more records?(y/n)..";
cin>>an;
}
fin.close();
goto a;
}
else
{
clrscr();
gotoxy(25,10);
cout<<dd<<'-'<<mm<<'-'<<yy;
gotoxy(15,20);
cout<<"ntttWrong password"
<<"ntttPress enter to continue";
getch();
clrscr();
goto a;
}
case 4:
clrscr();
char pa[]="ajai",secret[5];
int z;
gotoxy(25,10);
cout<<dd<<'-'<<mm<<'-'<<yy;
gotoxy(15,15);
cout<<"nntt Enter the password!!!nttttt";
for(z=0;z<4;z++)
{
secret[z]=getch();
cout<<"*";
}
getch();
if(!strcmpi(pa,secret))
{
h:
clrscr();
getch();
gotoxy(25,10);
cout<<dd<<'-'<<mm<<'-'<<yy;
gotoxy(10,15);
cout<<"ttt DELETION"
<<"ntttt--------nnt";
ifstream fa("theatre1.dat",ios::in);
ofstream fb("tempo1.dat",ios::out|ios::app);
char name[20],found='f',confirm='n';
cout<<"tt Enter the name of the"
<<"movie to be deleted:";
gets(name);
while(!fa.eof())
{
fa.read((char*)&f1,sizeof(f1));
if(!strcmpi(name,f1.mov_name))
{
found='t';
cout<<"ntt Are you sure,"
<<"you want to delete"
<<"this record?(y/n):";
cin>>confirm;
if(confirm=='n')
fb.write((char*)&f1,sizeof(f1));
else
cout<<"nnttt Record deleted!!";
}
else
fb.write((char*)&f1,sizeof(f1));
}
if(found=='f')
cout<<"nnttt Record not found!!";
fa.close();
fb.close();
remove("theatre1.dat");
rename("tempo1.dat","theatre1.dat");
cout<<"nnntt Wanna to continue?(y/n)....";
char s;
cin>>s;
if(s=='y')
goto h;
else
goto a;
}
else
{
clrscr();
gotoxy(25,10);
cout<<dd<<'-'<<mm<<'-'<<yy;
gotoxy(15,15);
cout<<"ttt WRONG PASSWORDnttt"
<<"Press Enter to continue";
getch();
clrscr();
gotoxy(25,10);
cout<<dd<<'-'<<mm<<'-'<<yy;
goto a;
}
case 5:
m:
clrscr();
gotoxy(25,10);
cout<<dd<<'-'<<mm<<'-'<<yy;
gotoxy(15,20);
cout<<"nnnttt 1.About the program!"
<<"nnttt 2.About the programmers!"
<<"nnttt 3.Go back!n";
cout<<"nttt Enter your choice:";
int j;
cin>>j;
switch(j)
{
case 1:
clrscr();
gotoxy(25,10);
cout<<dd<<'-'<<mm<<'-'<<yy;
gotoxy(15,10);
gotoxy(15,20);
cout<<"nntt This program is about"
<<"theatre1 management.nt";
cout<<"It allows user to search for the"
<<"movie details and to view list of"
<<"all movies running in the theatre";
cout<<"ntt It allows user to book"
<<"tickets for the concerned movie.";
cout<<"ntt allows the management of"
<<"the theatre1 to insert new movie"
<<"and delete the old ones";
getch();
goto a;
case 2:
clrscr();
getch();
goto a;
case 3:
goto a;
default:
clrscr();
gotoxy(15,15);
cout<<"ntt Wrong choice!"
<<"Press enter to go back";
getch();
goto m;
}
case 6:
clrscr();
gotoxy(25,10);
cout<<dd<<'-'<<mm<<'-'<<yy;
gotoxy(15,15);
cout<<"nttt ENJOY WATCHING IT('-')";
gotoxy(15,15);
cout<<"nnnnttt BYEEEEEE...........";
break;
default:
clrscr();
gotoxy(25,10);
cout<<dd<<'-'<<mm<<'-'<<yy;
gotoxy(15,20);
cout<<"tt You have entered a WRONG OPTION !!!!nt"
<<"tt Do you want to start again ?(y/n)nttt";
char ch;
cin>>ch;
clrscr();
if((ch=='y')||(ch=='Y'))
goto a;
break;
getch();
}
}
C++ project
C++ project
C++ project
C++ project
C++ project
C++ project
+
C++ project
C++ project
C++ project
C++ project
 Object oriented programming with c++ by E . Balagurusamy
(published by Tata McGraw-Hill)
 Computer science class XII by Sumita Arora
 Computer science class XII by J.B.Dixit (published by Lakshmi
publications)

More Related Content

PPTX
Introduction to C programming
PPTX
introduction to c language
PPTX
Introduction to C Language (By: Shujaat Abbas)
PPTX
PPT
Introduction to c_language
PPT
C Language
PPT
Introduction to c programming
PPSX
C programming basics
Introduction to C programming
introduction to c language
Introduction to C Language (By: Shujaat Abbas)
Introduction to c_language
C Language
Introduction to c programming
C programming basics

What's hot (19)

PDF
SULTHAN's - C Programming Language notes
PPTX
PPTX
1 introduction to c programming language
PDF
Abc c program
PPTX
introduction to c programming language
DOCX
Fundamentals of programming and problem solving
PPT
Book ppt
PPTX
C_Programming_Notes_ICE
PPT
introduction to C programming (C)
PPTX
COM1407: Introduction to C Programming
PPT
C PROGRAMMING
PPT
Programming in c
PPTX
INTRODUCTION TO C PROGRAMMING
DOCX
PPT
Tokens_C
DOC
C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
PDF
C programme presentation
DOCX
C programming language Reference Note
SULTHAN's - C Programming Language notes
1 introduction to c programming language
Abc c program
introduction to c programming language
Fundamentals of programming and problem solving
Book ppt
C_Programming_Notes_ICE
introduction to C programming (C)
COM1407: Introduction to C Programming
C PROGRAMMING
Programming in c
INTRODUCTION TO C PROGRAMMING
Tokens_C
C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
C programme presentation
C programming language Reference Note
Ad

Similar to C++ project (20)

PPTX
miniproject.pptx
PPTX
UNIT - 1- Ood ddnwkjfnewcsdkjnjkfnskfn.pptx
PDF
Object Oriented Programming using C++ - Part 1
PPTX
C++ language
PPTX
C++ Unit 1PPT which contains the Introduction and basic o C++ with OOOps conc...
PPTX
C++ theory
PPTX
C++ overview
PPTX
C_plus_plus
PPTX
PRINCE PRESENTATION(1).pptx
PDF
Cp week _2.
PPT
UsingCPP_for_Artist.ppt
PPTX
C++ with student management system project
PPT
C, C++ Interview Questions Part - 1
PDF
180 daraga cpp course session-1
PPTX
INTRODUCTION TO C++.pptx
PPTX
Presentation on C++ Programming Language
PPT
programming week 2.ppt
PDF
Programmingwithc 131017034813-phpapp01
PPT
lecture02-cpp.ppt
PPTX
C++ TRAINING IN AMBALA CANTT! BATRA COMPUTER CENTER
miniproject.pptx
UNIT - 1- Ood ddnwkjfnewcsdkjnjkfnskfn.pptx
Object Oriented Programming using C++ - Part 1
C++ language
C++ Unit 1PPT which contains the Introduction and basic o C++ with OOOps conc...
C++ theory
C++ overview
C_plus_plus
PRINCE PRESENTATION(1).pptx
Cp week _2.
UsingCPP_for_Artist.ppt
C++ with student management system project
C, C++ Interview Questions Part - 1
180 daraga cpp course session-1
INTRODUCTION TO C++.pptx
Presentation on C++ Programming Language
programming week 2.ppt
Programmingwithc 131017034813-phpapp01
lecture02-cpp.ppt
C++ TRAINING IN AMBALA CANTT! BATRA COMPUTER CENTER
Ad

Recently uploaded (20)

PDF
Trump Administration's workforce development strategy
PDF
HVAC Specification 2024 according to central public works department
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
20th Century Theater, Methods, History.pptx
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PDF
1_English_Language_Set_2.pdf probationary
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
PPTX
Introduction to pro and eukaryotes and differences.pptx
PDF
Indian roads congress 037 - 2012 Flexible pavement
PPTX
TNA_Presentation-1-Final(SAVE)) (1).pptx
PDF
Empowerment Technology for Senior High School Guide
PDF
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
PDF
Weekly quiz Compilation Jan -July 25.pdf
PDF
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PPTX
Computer Architecture Input Output Memory.pptx
PDF
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
My India Quiz Book_20210205121199924.pdf
Trump Administration's workforce development strategy
HVAC Specification 2024 according to central public works department
Practical Manual AGRO-233 Principles and Practices of Natural Farming
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
20th Century Theater, Methods, History.pptx
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
1_English_Language_Set_2.pdf probationary
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
Introduction to pro and eukaryotes and differences.pptx
Indian roads congress 037 - 2012 Flexible pavement
TNA_Presentation-1-Final(SAVE)) (1).pptx
Empowerment Technology for Senior High School Guide
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
Weekly quiz Compilation Jan -July 25.pdf
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
B.Sc. DS Unit 2 Software Engineering.pptx
Computer Architecture Input Output Memory.pptx
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
My India Quiz Book_20210205121199924.pdf

C++ project

  • 3. INTRODUCTION TO C++ “Language shapes the way we think and determines what we can think about” C++ is one of the latest, dynamic and powerful environments for programming. C++ was developed by Bjarne Stroustrup in the Bell laboratories in the early 1980’s. This section reveals some of the features and advantages of c++. Two languages contributed to its design-C, which provided low level features and simula 67,which provided the class concept. C++ is an example of an object-oriented language. Other OOP language includes Smalltalk and Ada. EVOLUTION OF THE NAME C++ Rick Mascitti coined the name c++ in the summer of 1983. The name signifies the evolutionary nature of the change from C. “++” is an increment operator. The slightly shorter name C+ is the syntax error. Connoisseurs ofC semantics find C++ inferior to ++C. The language is not called D, because it is an extension of C and does not attempt to remedy problems by removing features. SOME OF THE FEATURES OF C++ The reason for the popularity of C++ can by easily understood by its obvious features. i) POWER AND FLEXIBILITY
  • 4. C++ is an highly flexible, versatile and the very powerful programming language for developing any software especially the system software namely operating systems, compilers, editors, databases. ii) MAINTAINABILITYAND REUSABILITY C++ is most ideally suited for development of reusable software, that is, a software which can be used for wide variety of problems with no little change. This results in cost reduction of software development. iii) PORTABILITY C++ is machine independent, this means that a software development for a particular computer system can be used on other computers with no or little change. iv) RELIABILITYREGULARITYAND READABILITY C++ is reliable, regular and provides a lot of facilities for the simple codes to be made reliable. Its efficiency is very high, making it every programmers favorite environment. WHY C++ IS CALLED A MIDDLE LEVEL LANGUAGE: C++ is called a middle level language, not because its standard is lower than high level languages, but due to the fact that it combines the best features of assemble language and those of high level languages. C and C++ posses the efficiency of low level languages and the user – friendliness of high level languages so instead of calling it a middle level language, C++ can be more appropriately called a hybrid programming language. HOW C++ IN IMPROVEMENT OVER C?
  • 5. C++ is officially known as superset of the C language. C++ retains all of C’s strength interface its low level system programming, and its efficiency, economy and powerful expressions. In addition to these inherited features C++ introduces the dynamic world of object programming and creates a platform for high level program abstraction. C++ accomplishes all this with a simplicity and support for modularity while maintaining the compactness and execution ifficiency of C. Due to these reasons the increment operator is addes to the original name C thus making the new enhanced version, C++. BASE OF C++ The C language has itself evolved partly under the influence of the development of C++. The ANSI C standard contains function dexlaration syntax borrowed from “C with classes”. Borrowing works both ways for example, the void * pointer type was invented for ANSI C and first implemented in C++. C++ lays emphasis on modularity, strongly typed interfaces and flexibility. A SHORT NOTE ON OOP FACILITY OF C++ C++ has introduced object oriented programming to the world. C++ treats data and operation that can be performed on the data as an object and an object is treated as a class. So when a software is developed for a class rather than for individual data items, the software developed for the class is applicable to all the objects in the class. This results in the development of reusable software. PURPOSE OF C++ The C++ programming language is designed to  Be a better C  Support data abstraction  Support OOP features Viz  Data hiding
  • 6.  Encapsulation  Inheritance  Polymorphism  Objects and Classes SYSTEM CONFIGURATION HARDWARE  Microprocessor chip – Intel Pentium IV  Speed 2 GHz  RAM capacity 2 giga Byte  Hard Disk Drive 500 Giga Byte  Keyboard – 104 keys  Color Monitor – Samtron -15”  Mouse – Logitech  Printer – canon ink Jet SOFTWARE  MSDOS – Version 6.22  Windows 2007 ultimate  C++ version 3.0
  • 7.  Ms Word 2013 ABOUT THE PROJECT This project mainly concentrates on online booking of tickets for the movies. This C++ program uses concepts like classes, data files handiling and makeup the whole program’s using switch cases. It allows the user to search for the movie by entering the movie name, enable to view the list of all movies running in the theatre. This also allows the user to book tickets for the movie he prefers. This program will be easily accessible by the management staff of the theatre to insert or delete movie from the theatre. This provides a great help for both the staff and the user to maintain and preserve their records. Thus the project has been designed in such a fashion that even a common man understands it and can operate it. Thus it’s simplicity and wide utility has directed me to choose this project in this era of entertainment.
  • 8. DOCUMENTATION This program is been compiled by using Borland turbo C++ v 8.0. The working of the program is quite simple. It starts off by displaying a men8 as given below. 1.Searching 2.Booking 3.Insertion 4.Deletion 5.About 6.Exit  When the user chooses option 1: The program directs the user to a screen where 3 options are displayed showing the user , which are, search by movie name , view list of all movies or to return ot main menu. When the user chooses option:- 1.The program asks the user to enter the movie name to be searched. The program will now search the file for the details of the movie. If the movie name in the file matches
  • 9. the name entered by the user then the corresponding details will be displayed. 2.The program displays all the names of the movie present in the file. 3.The program directs the user to the main menu. When the entered option does not match in any file it displays “Movie not found” and returns to the main menu.  When the user chooses option 2: The program directs the user to the screen where it asks the user to enter the movie name for which he wants to book a ticket. If the name of the movie entered matches with the movies available. When the entered option does not match any in file it displays “Wrong option” and returns to the main menu.  When the user chooses option 3 : This option directs him to a screen where it asks him to enter the password for insertion of records. Then it asks for movie name, screen number , movie type and ticket cost and movie capacity. After entering it asks whether do you want to insert more records. When the password entered is wrong it shows a message “Wrong password” and directs him to the main menu.  When the user chooses option 4: The program directs the user to the screen where it asks him to enter password for deletion of records. Then it asks for the movie name to be deleted. Then it deletes the movie and shows the option the movie has been deleted. Do you want to delete more records. If the entered password is
  • 10. wrong it shows a message “Wrong password” and directs him to the main menu.  When the user chooses option 5: The program directs the user to a screen where 3 options are displayed showing the user , which are about the program, about the programmers, return to the main menu. When the user enters option:- 1.It displays details about the program and how the program is executed. 2.It displays details about the programmers. 3.The program directs him to the main menu.  When the user chooses option 6: The program exits and shows a message “ENJOY(‘-‘)” followed by “BYEEE….”. This statement shows that the user is going to exit from the program.
  • 11. HEADER FILES USED AND THEIR PURPOSE FSTREAM.H – for file handling, cin and cout CONIO.H – for clrscr() and getch() functions STDIO.H – for standard I/O operations DOS.H – for execution of program STRING.H – for string handling TIME.H – for time and local time functions
  • 12. LABLES USED:- This program makes use of certain number of labels. They are :  a:  s:  h:  m: With the help of ‘goto’ function, the program will be directed to the respective label. Class cinema:- This class stores the essential details of the movies running in the theatre. They variables stored in the program to store these details are :-
  • 13. Private members:-  screenno  mov_type  cost Public members:-  mov_name  cap The class also has 2 public member functions namely:-  get_data()  put_data() void main():- This function reads the number from the user as to operate on which operation is to be carried out. Then it is switched to the respective operation such as searching, booking, insertion, deletion and exiting.
  • 14. Variables used for manipulating are as shown below:- INTEGER VARIABLES:-  dd  mm  yy  choice[0]  choice[1]  i  n  k  z  j  rnum CHARACTER VARIABLES:-  mov
  • 15.  f  nam  ch  cha  ans  pas  p  an  pa  secret  name  found  confirm  s
  • 17. Coding: #include<fstream.h> #include<stdio.h> #include<conio.h> #include<string.h> #include<stdlib.h> #include<dos.h> #include<time.h> class cinema { int screenno; char mov_type; int cost; public: char mov_name[20]; int cap; void get_data(); void put_data(); } f1,temp; void cinema::get_data() { cout<<"tt Enter the movie's name:"; gets(mov_name); cout<<"tt Enter the screen number:"; cin>>screenno; cout<<"tt Enter the movie's type:"; cin>>mov_type; cout<<"tt Enter the movie's cost:"; cin>>cost; cout<<"tt Enter the movie's capacity:"; cin>>cap; } void cinema::put_data() { cout<<"tt DETAILS OF THE MOVIE ARE-:n" <<"tt --------------------------n"; cout<<"tt Movie Name:"; puts(mov_name); cout<<"tt Movie code:"<<screenno<<endl; cout<<"tt Movie type:"<<mov_type<<endl; cout<<"tt Movie cost:"<<cost<<endl; cout<<"tt Movie capacity:"<<cap<<endl; } void main()
  • 18. { clrscr(); struct date d; getdate(&d); int dd,mm,yy; dd=1*d.da_day; mm=1*d.da_mon; yy=1*d.da_year; int choice[2]; gotoxy(20,20); cout<<"Welcome to the world of unlimited entertainment!!!!!" <<"nntt Press Enter to continue"; getch(); a: clrscr(); gotoxy(25,10); cout<<dd<<'-'<<mm<<'-'<<yy; gotoxy(15,15); cout<<"Enter-:" <<"nnttt 1.Searching" <<"nnttt 2.Booking" <<"nnttt 3.Insertion" <<"nnttt 4.Deletion" <<"nnttt 5.About the Programmers" <<"nnttt 6.Exit nn" <<"ttt Enter your choice:"; cin>>choice[0]; switch(choice[0]) { case 1: clrscr(); gotoxy(25,10); cout<<dd<<'-'<<mm<<'-'<<yy; gotoxy(15,15); cout<<"1.Search by movie namenntt" <<"2.View list of all moviesnntt" <<"3.Go Backnntt Enter your choice:"; cin>>choice[1]; switch(choice[1]) { case 1: clrscr(); gotoxy(25,10); cout<<dd<<'-'<<mm<<'-'<<yy; ifstream fi("theatre1.dat",ios::in ); gotoxy(15,15); cout<<"ntt Enter the name of the movie";
  • 19. char mov[20],f='n'; gets(mov); cout<<"n"; while(!fi.eof()) { fi.read((char*)&f1,sizeof(f1)); if(!strcmpi(f1.mov_name,mov)) { clrscr(); gotoxy(25,10); cout<<dd<<'-'<<mm<<'-'<<yy; gotoxy(20,20); f1.put_data(); getch(); f='y'; break; } } if(f=='n') { clrscr(); gotoxy(25,15); cout<<dd<<":"<<mm<<":"<<yy; gotoxy(15,10); cout<<"nttMovie not found!!!!!"; } fi.close(); getch(); goto a; case 2: clrscr(); gotoxy(25,10); cout<<dd<<'-'<<mm<<'-'<<yy; ifstream aa("theatre1.dat",ios::in); gotoxy(15,12); cout<<"ntt THE LIST OF THE MOVIES ARE-:n"; int i=1; while(!aa.eof()) { aa.read((char*)&f1,sizeof(f1)); cout<<"ntt"<<i<<"."; puts(f1.mov_name); if(i%10==0) { cout<<"ntt Press Enter to Continue"; getch(); clrscr();
  • 20. gotoxy(25,10); cout<<dd<<'-'<<mm<<'-'<<yy; gotoxy(15,15); } i++; } getch(); aa.close(); goto a; case 3: goto a; default: clrscr(); gotoxy(25,10); cout<<dd<<'-'<<mm<<'-'<<yy; gotoxy(15,15); cout<<"tt You have enter a WRONG OPTION!!!n" <<"tt Do you want to start again ? (Y/N):"; char ch; cin>>ch; clrscr(); if((ch=='y')||(ch=='Y')) goto a; break; } break; case 2: s: clrscr(); gotoxy(25,10); cout<<dd<<'-'<<mm<<'-'<<yy; int rnum; fstream fi; fi.open("theatre1.dat",ios::out|ios::in); ofstream fo; fo.open("temp1.dat",ios::out|ios::app); gotoxy(5,15); cout<<"ntt Enter the name of the movie" <<"for which you want to buy tickets"; char nam[20],cha='f'; gets(nam); cout<<"nntt Enter the number of tickets" <<"u want to buy:"; int n; cin>>n; while(!fi.eof()) {
  • 21. fi.read((char*)&f1,sizeof(f1)); if(!strcmpi(nam,f1.mov_name)) { f1.cap-=n; fo.write((char*)&f1,sizeof(f1)); cha='t'; } else fo.write((char*)&f1,sizeof(f1)); } if(cha=='f') cout<<"ntt MOVIE NOT FOUNDn"; else { cout<<"nnttt TICKETS BOOKED"; cout<<"nnttt Your ID:"; cout<<((rnum=rand()%100)+15); cout<<"nnttta Enjoy athis amoviea"; cout<<"nnttt Show this ID to get ur ticket"; } remove("theatre1.dat"); rename("temp1.dat","theatre1.dat"); cout<<"nnntt Do you want to" <<"buy more tickets?(y/n):"; char ans; cin>>ans; if(ans=='y') goto s; goto a; case 3: clrscr(); char pass[]="MOVIE",p[6],an='y'; int k; gotoxy(25,10); cout<<dd<<'-'<<mm<<'-'<<yy; gotoxy(15,15); cout<<"tt Enter the password!!!nttttt"; for (k=0;k<5;k++) { p[k]=getch(); cout<<"*"; } getch(); if(!strcmp(pass,p)) { clrscr(); getch();
  • 22. ofstream fin; fin.open("theatre1.dat",ios::out|ios::app); while(an=='y') { clrscr(); gotoxy(25,10); cout<<dd<<'-'<<mm<<'-'<<yy; gotoxy(15,15); cout<<"ttt INSERTION" <<"ntttt-----" <<"nntt Enter The Details:" <<"nnn"; f1.get_data(); fin.write((char*)&f1,sizeof(f1)); clrscr(); gotoxy(25,10); cout<<dd<<'-'<<mm<<'-'<<yy; gotoxy(15,20); cout<<"nnttRecord added to file" <<"nttWant to enter more records?(y/n).."; cin>>an; } fin.close(); goto a; } else { clrscr(); gotoxy(25,10); cout<<dd<<'-'<<mm<<'-'<<yy; gotoxy(15,20); cout<<"ntttWrong password" <<"ntttPress enter to continue"; getch(); clrscr(); goto a; } case 4: clrscr(); char pa[]="ajai",secret[5]; int z; gotoxy(25,10); cout<<dd<<'-'<<mm<<'-'<<yy; gotoxy(15,15); cout<<"nntt Enter the password!!!nttttt"; for(z=0;z<4;z++) {
  • 23. secret[z]=getch(); cout<<"*"; } getch(); if(!strcmpi(pa,secret)) { h: clrscr(); getch(); gotoxy(25,10); cout<<dd<<'-'<<mm<<'-'<<yy; gotoxy(10,15); cout<<"ttt DELETION" <<"ntttt--------nnt"; ifstream fa("theatre1.dat",ios::in); ofstream fb("tempo1.dat",ios::out|ios::app); char name[20],found='f',confirm='n'; cout<<"tt Enter the name of the" <<"movie to be deleted:"; gets(name); while(!fa.eof()) { fa.read((char*)&f1,sizeof(f1)); if(!strcmpi(name,f1.mov_name)) { found='t'; cout<<"ntt Are you sure," <<"you want to delete" <<"this record?(y/n):"; cin>>confirm; if(confirm=='n') fb.write((char*)&f1,sizeof(f1)); else cout<<"nnttt Record deleted!!"; } else fb.write((char*)&f1,sizeof(f1)); } if(found=='f') cout<<"nnttt Record not found!!"; fa.close(); fb.close(); remove("theatre1.dat"); rename("tempo1.dat","theatre1.dat"); cout<<"nnntt Wanna to continue?(y/n)...."; char s; cin>>s;
  • 24. if(s=='y') goto h; else goto a; } else { clrscr(); gotoxy(25,10); cout<<dd<<'-'<<mm<<'-'<<yy; gotoxy(15,15); cout<<"ttt WRONG PASSWORDnttt" <<"Press Enter to continue"; getch(); clrscr(); gotoxy(25,10); cout<<dd<<'-'<<mm<<'-'<<yy; goto a; } case 5: m: clrscr(); gotoxy(25,10); cout<<dd<<'-'<<mm<<'-'<<yy; gotoxy(15,20); cout<<"nnnttt 1.About the program!" <<"nnttt 2.About the programmers!" <<"nnttt 3.Go back!n"; cout<<"nttt Enter your choice:"; int j; cin>>j; switch(j) { case 1: clrscr(); gotoxy(25,10); cout<<dd<<'-'<<mm<<'-'<<yy; gotoxy(15,10); gotoxy(15,20); cout<<"nntt This program is about" <<"theatre1 management.nt"; cout<<"It allows user to search for the" <<"movie details and to view list of" <<"all movies running in the theatre"; cout<<"ntt It allows user to book" <<"tickets for the concerned movie."; cout<<"ntt allows the management of"
  • 25. <<"the theatre1 to insert new movie" <<"and delete the old ones"; getch(); goto a; case 2: clrscr(); getch(); goto a; case 3: goto a; default: clrscr(); gotoxy(15,15); cout<<"ntt Wrong choice!" <<"Press enter to go back"; getch(); goto m; } case 6: clrscr(); gotoxy(25,10); cout<<dd<<'-'<<mm<<'-'<<yy; gotoxy(15,15); cout<<"nttt ENJOY WATCHING IT('-')"; gotoxy(15,15); cout<<"nnnnttt BYEEEEEE..........."; break; default: clrscr(); gotoxy(25,10); cout<<dd<<'-'<<mm<<'-'<<yy; gotoxy(15,20); cout<<"tt You have entered a WRONG OPTION !!!!nt" <<"tt Do you want to start again ?(y/n)nttt"; char ch; cin>>ch; clrscr(); if((ch=='y')||(ch=='Y')) goto a; break; getch(); } }
  • 32. +
  • 37.  Object oriented programming with c++ by E . Balagurusamy (published by Tata McGraw-Hill)  Computer science class XII by Sumita Arora  Computer science class XII by J.B.Dixit (published by Lakshmi publications)