Академический Документы
Профессиональный Документы
Культура Документы
Neeraj yadav
XII Science
CERTIFICATE
This is Certify that Neeraj yadav class XII Science of KendriyaVidyalaya NO.1 NSB,
has Successfully completed his project in Computer Science for
AISSCE as
Date :
Roll no:
Signature of
Signature of
Internal Examiner
External Examiner
Principal:
ACKNOWLEDGEMENT
Neeraj yadav
INDEX
INRODUCTION
C++ is a statically typed, compiled, general purpose, case-sensitive, freeform programming language that supports procedural, object-oriented,
and generic programming.C++ is regarded as a middle-level language,
as it comprises a combination of both high-level and low-level language
features. C++ was developed by BjarneStroustrup starting in 1979 at Bell
Labs in Murray Hill, New Jersey as an enhancement to the C language and
originally named C with Classes but later it was renamed C++ in 1983.C+
+ is a superset of C, and that virtually any legal C program is a legal C++
program.The most important thing to do when learning C++ is to focus on
concepts and not get lost in language technical details.
C++ is used by hundreds of thousands of programmers in essentially
every application domain.C++ is being highly used to write device drivers
and other software that rely on direct manipulation of hardware under
realtimeconstraints.C++ is widely used for teaching and research because
it is clean enough for successful teaching of basic concepts.Anyone who
has used either an Apple Macintosh or a PC running Windows has
indirectly used C++ because the primary user interfaces of these systems
are written in C++.
Our project CRICKET RECORD KEEPING
in
part
discrete,
to
address
reusable
common
units
of
problems
programming
by
strongly
logic .
The
contrast to the existing modular programming that had been dominant for
many years that focused on the function of a module, rather than
specifically the data, but equally provided for code reuse, and selfsufficient
reusable
units
of
programming
logic,
Encapsulation
Encapsulation refers to the creation of self-contained modules that bind
processing functions to the data. These user-defined data types are called
"classes," and one instance of a class is an "object." For example, in a
payroll system, a class could be Manager, and Pat and Jan could be two
instances (two objects) of the Manager class. Encapsulation ensures good
code modularity, which keeps routines separate and less prone to conflict
with each other.
Inheritance Passes "Knowledge" Down
Classes are created in hierarchies, and inheritance allows the structure
and methods in one class to be passed down the hierarchy. That means
less programming is required when adding functions to complex systems.
If a step is added at the bottom of a hierarchy, then only the processing
and data associated with that unique step needs to be added. Everything
else about that step is inherited. The ability to reuse existing objects is
considered a major advantage of object technology.
Polymorphism Takes any Shape
Object-oriented programming allows procedures about objects to be
created whose exact type is not known until runtime. For example, a
screen cursor may change its shape from an arrow to a line depending on
the program mode. The routine to move the cursor on screen in response
to mouse movement would be written for "cursor," and polymorphism
allows that cursor to take on whatever shape is required at runtime. It also
allows new shapes to be easily integrated.
<conio.h>,
<stdio.h>,
<string.h>,
<fstream.h>,
<ctype.h> and <process.h> are used in the software. Classes and objects
are also used in this software.
REQUIREMENTS
HARDWARE REQUIRED
Printer, to print the required documents of the project
Compact Drive
Processor : Pentium III
Ram : 64 MB
Harddisk : 20 GB.
SOFTWARE REQUIRED
Operating system : Windows XP,Windows 7
Turbo C++, for execution of program and
Ms word, for presentation of output.
www.cbseportal.com
www.cbseportal.com
CODING
#include<fstream.h>
#include<conio.h>
#include<ctype.h>
#include<stdio.h>
#include<string.h>
#include<process.h>
class data
{
char name[30];
intplayercode;
int M1R;
int M2R;
int M3R;
inttotal_run;
public:
data()
{
playercode=0;
strcpy(name,"");
M1R=0;
M2R=0;
M3R=0;
total_run=0;
}
voidenter_name_runs()
{
cout<<"\nEnter player code(Integral) : ";
cin>>playercode;
cout<<"\nEnter player name : ";
gets(name);
cout<<"\nFirst match run(s)
: ";
cin>>M1R;
cout<<"\nSecond match run(s)
: ";
cin>>M2R;
cout<<"\nThird match run(s) : ";
cin>>M3R;
total_runs();
}
voidshow_record()
{
cout<<"\nPlayer code
:"<<playercode;
cout<<"\nPlayer name
: "<<name;
: "<<total_run;
}
voidtotal_runs()
{
total_run=M1R+M2R+M3R;
}
intgetplayercode()
{
returnplayercode;
}
intgettotalruns()
{
returntotal_run;
}
char* get_name()
{
return name;
}
voidmodify_data()
{
cout<<"\nEnter new data for modification :::::::: ";
cout<<"\nEnter First match run(s) : ";
cin>>M1R;
cout<<"\nEnter Second match run(s) : ";
cin>>M2R;
cout<<"\nEnter Third match run(s) : ";
cin>>M3R;
total_runs();
}
};
data d;
fstream file;
fstream file1;
//* * * * * * * * * * CALCULATE HIGHEST RUN(s) * * * * * * * * * * * * *
* * *
void highest()
{
file.open("record.dat",ios::in|ios::binary);
int post=0,tr=0,plr_code=0,run=0;
file.read((char*)&d,sizeof(d));
while(file)
{
run=d.gettotalruns();
if(run>tr)
{
post=file.tellg();
tr=run;
}
file.read((char*)&d,sizeof(d));
}file.close();
file.open("record.dat",ios::in|ios::binary);
file.seekg(post-sizeof(d));
file.read((char*)&d,sizeof(d));
cout<<"\n::::::::::Highest run getter data::::::::::";
cout<<"\nHighest run(s) getter code
: "<<d.getplayercode();
: "<<tr;
floatavg;
avg=(tr)/3;
cout<<"\n
Player average is
: "<<avg;
file.close();
}
//* * * * * * * * * * * * INSERT NEW RECORD(s) * * * * * * * * * * * * *
* * *
void insert()
{
inti,no;
file.open("record.dat",ios::in|ios::app|ios::binary);
cout<<"\n
";
//insert records
file.write((char*)&d,sizeof(d));
}file.close();
}
//* * * * * * * * * * * * * DISPLAY EXISTING RECORD(s) * * * * * * * * *
* * * * *
void display()
{
file.open("record.dat",ios::in|ios::binary);
cout<<"\n|||||||||||||||||||||| Entered record(s) ||||||||||||||||||||||||";
file.read((char*)&d,sizeof(d));
while(file)
{
d.show_record();
file.read((char*)&d,sizeof(d));
}file.close();
}
//* * * * * * * * * * * * * SEARCH RECORD * * * * * * * * * * * * * * * *
void search()
{
intp,r,srch=0;
file.open("record.dat",ios::in|ios::binary);
cout<<"\nEnter the player code to see his records : ";
cin>>r;
file.seekg(0);
file.read((char*)&d,sizeof(d));
while(file)
{
p=d.getplayercode();
if(r==p)
{
d.show_record();
srch=1;
break;
}
else
{
file.read((char*)&d,sizeof(d));
}
}file.close();
if(srch==0)
{
cout<<"\nThere is no record which have this playercode .";
}
}
";
}
}
//* * * * * * * * * * * * * * * DELETE RECORD* * * * * * * * * * * * * *
* * * * *
voiddelete_record()
{int pointer=0,remove_record=0,size=0,code_get=0;
// size=sizeof(file);
cout<<"\n Enter the player code whose record to be deleated : ";
cin>>remove_record;
file.open("record.dat",ios::in|ios::out|ios::binary);
file1.open("tempo.dat",ios::in|ios::out|ios::binary);
file.seekg(0);
while(file)
{
file.read((char*)&d,sizeof(d));
code_get=d.getplayercode();
if(remove_record==code_get)
{
cout<<" ";
}
else
{
file1.write((char*)&d,sizeof(d));
}
}file.close();
file1.close();
remove("record.dat");
rename("tempo.dat","record.dat");
}
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * *
void main()
{
clrscr();
int choice;
charans='n';
do
{
cout<<"\n=*=*=*=*=*=*=*=*=* PLAYER RECORD KEEPING SYSTEM
-Aditya*=*=*=*=*=*=*=*=*=*";
www.cbseportal.com
OUTPUT
Welcome
'6' Quit
ww.cbseportal.com
www.cbseportal.com
www.cbseportal.com
w.cbseportal.com
www.cbseportal.com
BIBLIOGRAPHY
Textbook Referred: