Sie sind auf Seite 1von 62

_____ACKNOWLEDGEMENT

I would like to convey my heartfelt thanks to Mr. Sudhir Gautam my computer Teacher who always gives valuable suggestions and guidance for completion of my project and has been a source of encouragement and of great help during conduct of this project. My project has been success only because of his guidance.

Devender kumar

___________CERTIFICATE
This is to certify that the project Cricket Management is fully developed by Master DEVENDER KUMAR the student of ST. THOMAS SCHOOL , BAHADURGARH. The work carried out is very good and upto the standard of partial fulfillment of the requirements for the Senior Secondary C.B.S.E examination.

Sudhir Gautam (PGT computer)

Principal

Software And Hardware Requirements


H /W REQUIREMENTS: MICROSOFT WINDOWS 2000/XP/win 7/win8 256 MB RAM 40 GB HARD DISK WINDOWS 2000/XP COMPATIBLE MOUSE, KEYBOARD S/W REQUIREMENTS: TURBO C++

Cricket Management

TO ADD A NEW PLAYER TO MODIFY A PLAYER TO DELETE A PLAYER


TO SEE DETAIL OF PLAYER

TO DISPLAY THE LIST OF A TEAM

TO SEARCH A PLAYER

Batsman or Bowler
England India South Africa Pakistan

Australia

About The Project


THE PROGRAM IS TITLED Cricket Managing WHICH IS ABOUT managing different teams in cricket.

IT INCLUDES ENTERING THE DETAILS of different international cricketers from different countries.

THE PROGRAM INCLUDES THE USES OF VARIOUS CONCEPTS TAUGHT IN C++ TILL DATE.

CODING
/* ** CRICKET MANAGEMENT SYSTEM ** */ #include<graphics.h> #include<fstream.h> #include<iomanip.h> #include<stdlib.h> #include<string.h> #include<stdio.h> #include<conio.h> #include<bios.h> #include<dos.h>

char* RECORDOFBATSMEN[]={"India.dat","Pak.dat","Aust.dat","SA.dat","Eng.dat"};

char* RECORDOFBOWLER[]={"India1.dat","Pak1.dat","Aus1.dat","SA1.dat","Eng1.dat"};

// a function to choose a team... int choice() { clrscr(); int ch;

gotoxy(30,15); cout<<" CHOOSE ANY TEAM"; gotoxy(30,16); cputs(""); gotoxy(30,18); cout<<" 1.India "; gotoxy(30,20); cout<<" 2.Pakistan "; gotoxy(30,22); cout<<" 3.Australia "; gotoxy(30,24); cout<<" 4.South Africa"; gotoxy(30,26); cout<<" 5.England"; gotoxy(30,28); cout<<" Enter your choice.... "; cin>>ch; return ch-1; }

//a structure to enter the date of birth... struct DOB { int d; int m; int y;

};

//a class to input & display details of a player... class PLAYER { char fname[30]; char ename[30]; int age; char state[30]; long matchplayed; DOB DATE;

public: void pinput(); void pdisplay(); char* getname(); void name() { cout<<"\n\t\t\t\t"<<fname<<" "<<ename<<"\n"; } }P,S;

//a pointer to return name of player... char* PLAYER::getname() { return fname;

//a class to enter and display detail of a batsmen... class BATSMEN:public PLAYER { float strikerate; float average; long runsmade; long highest; int no_50; int no_4; int no_100; int no_6;

public: void BATinput(); void BATdisplay(); void update(); };

//a member function to enter detail of a batsmen... void BATSMEN::BATinput() { P.pinput(); gotoxy(30,22); cout<<" Strike Rate :";

cin>>strikerate; gotoxy(30,23); cout<<" Runs made cin>>runsmade; gotoxy(30,24); cout<<" No. of fours cin>>no_4; gotoxy(30,25); cout<<" No. of sixes cin>>no_6; gotoxy(30,26); cout<<" No. of fifties cin>>no_50; gotoxy(30,27); cout<<" No. of centuries cin>>no_100; gotoxy(30,28); cout<<" Highest score cin>>highest; gotoxy(30,29); cout<<" Average cin>>average; } :"; :"; :"; :"; :"; :"; :";

//a member function to display detail of a batsmen... void BATSMEN:: BATdisplay()

{ P.pdisplay(); gotoxy(30,21); cout<<" Strike rate gotoxy(30,22); cout<<" Runs made gotoxy(30,23); cout<<" No.of fours gotoxy(30,24); cout<<" No.of sixes gotoxy(30,25); cout<<" No.of fifties gotoxy(30,26); cout<<" No.of centuries gotoxy(30,27); cout<<" Highest score gotoxy(30,28); cout<<" Average } :"<<average; :"<<highest; :"<<no_100; :"<<no_50; :"<<no_6; :"<<no_4; :"<<runsmade; :"<<strikerate;

//a member function to update record of a batsmen... void BATSMEN::update() { int runs; int index=1; int index1;

gotoxy(27,16); cout<<" Enter the runs made by player....."; cin>>runs; while(runs>6||runs<0) { index1=16+index; gotoxy(27,index1); cout<<" Please enter the runs made by player....."; cin>>runs; index++; } if(runs ==4) { no_4++; runsmade+=4; } else if(runs==6) { no_6++; runsmade+=6; } else runsmade+=runs;

//a class to enter and display detail of a bowler... class BOWLER:public PLAYER { int maidenover ; int runsgiven; int wicket_taken; int catches_taken; int overbowled; float speed; public: void BOWLinput(); void BOWLdisplay(); void update_over(); };

//a member function to enter detail of a bowler... void BOWLER::BOWLinput() { S.pinput(); gotoxy(30,22); cout<<" Maiden over cin>>maidenover; gotoxy(30,23); cout<<" Runs given cin>>runsgiven; gotoxy(30,24); :"; :";

cout<<" Wicket taken cin>>wicket_taken; gotoxy(30,25); cout<<" Over bowled cin>>overbowled; gotoxy(30,26); cout<<" Speed cin>>speed; gotoxy(30,27); cout<<" Catches taken cin>>catches_taken; } :";

:";

:";

:";

//a member function to display detail of a bowler... void BOWLER::BOWLdisplay() { S.pdisplay(); gotoxy(30,21); cout<<" Maiden over gotoxy(30,22); cout<<" Runs given gotoxy(30,23); cout<<" Wicket taken gotoxy(30,24); cout<<" Over bowled gotoxy(30,25); :"<<overbowled; :"<<wicket_taken; :"<<runsgiven; :"<<maidenover;

cout<<" Speed gotoxy(30,26); cout<<" Catches taken }

:"<<speed;

:"<<catches_taken;

//a member function to update record of a bowler... void BOWLER::update_over() { int wickets; int runs; int runs1; int runs2; int runs3; int runs4; int runs5; int runs6; gotoxy(27,16); cout<<" ENTER THE RUNS"; gotoxy(27,18); cout<<" 1st ball :"; cin>>runs1; gotoxy(27,19); cout<<" 2nd ball :"; cin>>runs2; gotoxy(27,20); cout<<" 3rd ball :";

cin>>runs3; gotoxy(27,21); cout<<" 4th ball :"; cin>>runs4; gotoxy(27,22); cout<<" 5th ball :"; cin>>runs5; gotoxy(27,23); cout<<" 6th ball :"; cin>>runs6; if(runs1==0 && runs2==0 &&runs3==0 &&runs4==0 &&runs5==0 &&runs6==0) maidenover++; else { runs=runs1+runs2+runs3+runs4+runs5+runs6; runsgiven=runsgiven+runs; } gotoxy(27,23); cout<<" Enter the number of wickets taken :"; cin>>wickets; wicket_taken=wicket_taken+wickets; overbowled+=1; }

//a member function to enter detail of a player...

void PLAYER::pinput() { int A; char ch; clrscr(); gotoxy(25,13); cputs(""); gotoxy(25,14); cputs(" DETAILS OF THE PLAYER ");

gotoxy(25,15); cputs(""); gotoxy(30,17); cout<<" First Name gets(fname); gotoxy(30,18); cout<<" Last Name gets(ename); gotoxy(30,19); cout<<" State cin>>state; gotoxy(30,20); cout<<" No.of matches played cin>>matchplayed; gotoxy(30,21); cout<<" Date of birth (mm:dd:yy) :"; cin>>DATE.m; :"; :"; :"; :";

gotoxy(61,21); cout<<":"; gotoxy(64,21); cin>>DATE.d; gotoxy(66,21); cout<<":"; gotoxy(68,21); cin>>DATE.y; }

//a member function to display detail of a player... void PLAYER::pdisplay() { clrscr(); gotoxy(25,13); cputs(""); gotoxy(25,14); cputs(" DETAILS OF THE PLAYER ");

gotoxy(25,15); cputs(""); gotoxy(30,17); cout<<" Name gotoxy(30,18); cout<<" State gotoxy(30,19); cout<<" No.of matches played :"<<matchplayed; :"<<state; :"<<fname<<" "<<ename;

gotoxy(30,20); cout<<" Date of birth } :"<<DATE.m<<":"<<DATE.d<<":"<<DATE.y;

//a function to modify both batsmen & bowler... void modify() { int ch; int A; long pos; fstream f; char name[30]; char found='f'; clrscr(); gotoxy(25,11); cputs(""); gotoxy(25,12); cputs(" CHOOSE ANY ONE ");

gotoxy(25,13); cputs(""); gotoxy(30,15); cout<<" 1.BATSMEN"; gotoxy(30,16); cout<<" 2.BOWLER"; gotoxy(30,18); cout<<" Enter your choice: ";

gotoxy(30,19); cin>>ch; switch(ch) { case 1: A=choice(); BATSMEN BAT; f.open(RECORDOFBATSMEN[A],ios::in|ios::out|ios::binary); clrscr(); gotoxy(30,14); cout<<" Enter name of the batsman: "; cin>>name; while (!f.eof()) { pos=f.tellg(); f.read((char *)&BAT,sizeof(BAT)); f.read((char *)&P,sizeof(P)); if(strcmp(P.getname(),name)==0) { BAT.update(); f.seekg(pos); f.write((char *)&BAT,sizeof(BAT)); f.write((char *)&P,sizeof(P)); found='t'; break; }

} if(found=='f') { gotoxy(27,17); cout<<" Record not found"; } f.close(); break; case 2: A=choice(); BOWLER BOWL; f.open(RECORDOFBOWLER[A],ios::in|ios::out|ios::binary); clrscr(); gotoxy(27,14); cout<<" Enter name of the bowler: "; cin>>name; while(!f.eof()) { pos=f.tellg(); f.read((char *)&S,sizeof(S)); f.read((char *)&BOWL,sizeof(BOWL)); if(strcmp(S.getname(),name)==0) { f.seekg(0); f.read((char*)&BOWL,sizeof(BOWL)); BOWL.update_over();

f.seekg(pos); f.write((char *)&BOWL,sizeof(BOWL)); f.seekg(pos); f.write((char *)&S,sizeof(S)); found='t'; break; } } if(found=='f') { gotoxy(27,17); cout<<" Record not found"; } f.close(); break; default: gotoxy(30,20); cout<<" SORRY! Wrong Choice"; break; } }

//a function to display all the batsmen of a team... void displaybatsmen(int A) { ifstream fin;

BATSMEN BAT; clrscr(); fin.open(RECORDOFBATSMEN[A],ios::binary|ios::in); fin.seekg(0); gotoxy(25,11); cputs(""); gotoxy(25,12); cputs(" THE BATSMEN ARE ");

gotoxy(25,13); cputs(""); while(!fin.eof()) { fin.read((char*)&BAT,sizeof(BAT)); fin.read((char*)&P,sizeof(P)); if(fin.eof()) break; P.name(); } fin.close(); }

//a function to display all the bowler of a team... void displaybowlers(int A) { ifstream fin; BOWLER BOWL;

clrscr(); fin.open(RECORDOFBOWLER[A],ios::binary|ios::in); fin.seekg(0); gotoxy(25,11); cputs(""); gotoxy(25,12); cputs(" THE BOWLER ARE ");

gotoxy(25,13); cputs(""); while(!fin.eof()) { fin.read((char*)&BOWL,sizeof(BOWL)); fin.read((char*)&S,sizeof(S)); if(fin.eof()) break; S.name(); } fin.close(); }

//a function to search detail of a player... void search() { int ch; int A; char found='n';

char name[30]; ifstream fin; fstream f; clrscr(); gotoxy(25,11); cputs(""); gotoxy(25,12); cputs(" CHOOSE ANY ONE ");

gotoxy(25,13); cputs(""); gotoxy(30,15); cout<<" 1.BATSMEN"; gotoxy(30,16); cout<<" 2.BOWLER"; gotoxy(30,18); cout<<" Enter choice: "; gotoxy(30,19); cin>>ch; switch(ch) { case 1: A=choice(); BATSMEN BAT; fin.open(RECORDOFBATSMEN[A],ios::in|ios::binary); displaybatsmen(A); gotoxy(25,40);

cout<<"Press any key to continue..."; getch(); clrscr(); gotoxy(10,14); cout<<" Enter the name of player whose details you want to see "; cin>>name; while (!fin.eof()) { fin.read((char *)&BAT,sizeof(BAT)); fin.read((char *)&P,sizeof(P)); if(strcmp(P.getname(),name)==0) { BAT.BATdisplay(); found='y'; break; } } if(found=='n') { gotoxy(27,17); cout<<" SORRY!! record not in found in file"; } fin.close(); break; case 2: A=choice();

BOWLER BOWL; f.open(RECORDOFBOWLER[A],ios::in|ios::out|ios::binary); displaybowlers(A); gotoxy(25,40); cout<<"Press any key to continue..."; getch(); clrscr(); gotoxy(10,14); cout<<" Enter name of the bowler whose detail you want to see:"; cin>>name; while(!f.eof()) { f.read((char *)&S,sizeof(S)); if(strcmp(S.getname(),name)==0) { f.seekg(0); f.read((char*)&BOWL,sizeof(BOWL)); f.read((char*)&S,sizeof(S)); BOWL.BOWLdisplay(); found='y'; break; } } if(found=='n') { gotoxy(27,17);

cout<<" SORRY!! Record not in found in file"; } f.close(); break; default: gotoxy(27,17); cout<<"\n SORRY! Wrong Choice"; break; } }

//a function to display names of batsmen & bowler of a team... void list() { int ch; int A; ifstream fin; fstream f; clrscr(); gotoxy(25,11); cputs(""); gotoxy(25,12); cputs(" CHOOSE ANY ONE ");

gotoxy(25,13); cputs(""); gotoxy(30,15);

cout<<" 1.BATSMEN"; gotoxy(30,16); cout<<" 2.BOWLER"; gotoxy(30,18); cout<<" Enter choice: "; gotoxy(30,19); cin>>ch; switch(ch) { case 1: A=choice(); BATSMEN BAT; fin.open(RECORDOFBATSMEN[A],ios::in|ios::binary); displaybatsmen(A); break; case 2: A=choice(); BOWLER BOWL; f.open(RECORDOFBOWLER[A],ios::in|ios::out|ios::binary); displaybowlers(A); break; default: gotoxy(27,17); cout<<"\n SORRY! Wrong Choice"; break; }

//a function to delete the details of batsmen & bowler... void dele() { int ch; int A; char found='f'; char name[30]; char confirm='n'; ifstream fin; fstream f; ofstream fout; clrscr(); gotoxy(25,11); cputs(""); gotoxy(25,12); cputs(" CHOOSE ANY ONE ");

gotoxy(25,13); cputs(""); gotoxy(30,15); cout<<" 1.BATSMEN"; gotoxy(30,17); cout<<" 2.BOWLER"; gotoxy(30,19); cout<<" Enter your choice: ";

cin>>ch; switch(ch) { case 1: A=choice(); BATSMEN BAT; fin.open(RECORDOFBATSMEN[A],ios::binary); fout.open("temp.dat",ios::binary); clrscr(); gotoxy(18,14); cout<<" Enter the name of player whose record u want to delete "; cin>>name; while (!fin.eof()) { fin.read((char *)&BAT,sizeof(BAT)); fin.read((char *)&P,sizeof(P)); if(strcmp(P.getname(),name)==0) { found='t'; gotoxy(18,20); cout<<" ARE U SURE U WANT TO DELETE THIS RECORD (Y/N)..."; cin>>confirm; if(confirm=='n') { fout.write((char*)&BAT,sizeof(BAT)); fout.write((char*)&P,sizeof(P));

} break; } else { fout.write((char*)&BAT,sizeof(BAT)); fout.write((char*)&P,sizeof(P)); } } if(found=='f') { gotoxy(18,17); cout<<" SORRY!! Record not found"; } fin.close(); fout.close(); remove(RECORDOFBATSMEN[A]); rename("temp.dat",RECORDOFBATSMEN[A]); break; case 2: A=choice(); BOWLER BOWL ; fin.open(RECORDOFBOWLER[A],ios::binary); fout.open("temp1.dat",ios::binary); clrscr(); gotoxy(18,14);

cout<<" Enter name of the bowler: "; cin>>name; while(!fin.eof()) { fin.read((char *)&S,sizeof(S)); fin.read((char *)&BOWL,sizeof(BOWL)); if(strcmp(S.getname(),name)==0) { found='t'; gotoxy(18,17); cout<<" ARE U SURE U WANT TO DELETE THIS RECORD (Y/N)..."; cin>>confirm; if(confirm=='n') { fout.write((char*)&BOWL,sizeof(BOWL)); fout.write((char*)&S,sizeof(S)); } break; } else { fout.write((char*)&BOWL,sizeof(BOWL)); fout.write((char*)&S,sizeof(S)); } } if(found=='f')

{ gotoxy(18,17); cout<<" SORRY!! Record not found"; } f.close(); fin.close(); fout.close(); remove(RECORDOFBOWLER[A]); rename("temp1.dat",RECORDOFBOWLER[A]); break; default: gotoxy(18,17); cout<<" SORRY! Wrong Choice"; break; } }

//a function to input the details of batsmen & bowler... void write() { int i; int A; char ans; ifstream fin; ofstream fout; clrscr();

gotoxy(25,11); cputs(""); gotoxy(25,12); cputs(" CHOOSE ANY ONE ");

gotoxy(25,13); cputs(""); gotoxy(30,15); cout<<" 1.BATSMEN"; gotoxy(30,17); cout<<" 2.BOWLER"; gotoxy(30,19); cout<<" Enter your choice:..... "; cin>>i; switch(i) { case 1: ans='y'; A=choice(); BATSMEN BAT; fout.open(RECORDOFBATSMEN[A],ios::binary|ios::app); while(ans=='y'||ans=='Y') { BAT.BATinput(); fout.write((char*)&BAT,sizeof(BAT)); fout.write((char*)&P,sizeof(P)); gotoxy(30,30);

cout<<" Do you want to enter more record ?(Y/N)...."; cin>>ans; } fout.close(); break; case 2: ans='y'; A=choice(); BOWLER BOWL; fout.open(RECORDOFBOWLER[A],ios::binary|ios::app); cout<<"team"<<RECORDOFBOWLER[A]; while(ans=='y'||ans=='Y') { BOWL.BOWLinput(); fout.write((char*)&BOWL,sizeof(BOWL)); fout.write((char*)&S,sizeof(S)); gotoxy(30,30); cout<<" Do you want to enter more record ?(Y/N)...."; cin>>ans; } fout.close(); break; default: gotoxy(30,30); cout<<"\n SORRY!! Wrong Choice"; break;

} }

//a function to display the details of batsmen & bowler... void read() { int i; int A; char ans; ifstream fin; clrscr(); gotoxy(25,11); cputs(""); gotoxy(25,12); cputs(" CHOOSE ANY ONE ");

gotoxy(25,13); cputs(""); gotoxy(30,15); cout<<" 1.BATSMEN"; gotoxy(30,17); cout<<" 2.BOWLER"; gotoxy(30,19); cout<<" Enter your choice..... ";

cin>>i; switch(i)

{ case 1: A=choice(); BATSMEN BAT; fin.open(RECORDOFBATSMEN[A],ios::binary|ios::in); fin.seekg(0); while(!fin.eof()) { fin.read((char*)&BAT,sizeof(BAT)); fin.read((char*)&P,sizeof(P)); if(fin.eof()) break; BAT.BATdisplay(); } fin.close(); break; case 2: A=choice(); BOWLER BOWL; fin.open(RECORDOFBOWLER[A],ios::binary|ios::in); fin.seekg(0); while(!fin.eof()) { fin.read((char*)&BOWL,sizeof(BOWL)); fin.read((char*)&S,sizeof(S)); if(fin.eof()) break; BOWL.BOWLdisplay();

} fin.close(); break; default: gotoxy(30,30); cout<<"\n SORRY!! Wrong Choice"; break; } }

// a function displaying acknowldgement... void ack() { textbackground(BLACK); textcolor(MAGENTA); clrscr(); gotoxy(20,10); cout<<" I would like to record my sincere"; gotoxy(20,12); cout<<" thanks and deep sense gratitude to "; gotoxy(20,14); cout<<" my respected teacher Mr.SUDHIR GAUTAM "; gotoxy(20,16); cout<<" for his valuable gratitude interast"; gotoxy(20,18); cout<<" and constant encouragement for the ";

gotoxy(20,20); cout<<" fulfillment of the project."; gotoxy(20,23); cout<<" I would also like to thank my "; gotoxy(20,25); cout<<" parents and friends for their constant"; gotoxy(20,27); cout<<" moral support and encouragemant."; delay(1000); }

//a functon showing starting of priject... void starting1() { clrscr(); int i; int j; textbackground(BLACK); textcolor(MAGENTA); clrscr(); delay(100); for (i=2,j=63;j>68,i<28;i++,j--) { delay(100); gotoxy(i,12); cputs(" HARSHITA ");

gotoxy(i,14); cputs(" DEVENDER "); gotoxy(i,16); cputs(" HIMANSHU"); } textcolor(CYAN+BLINK); gotoxy(36,21); cputs(" PRESENTS " ); { sound(600); delay(200); nosound(); sound(7); delay(200); nosound(); sound(600); delay(200); nosound(); sound(7); delay(200); nosound(); sound(600); delay(200); nosound(); sound(7); delay(200);

nosound(); sound(600); delay(200); nosound(); sound(7); delay(200); nosound(); sound(700); delay(200); nosound(); sound(7); delay(200); nosound(); sound(900); delay(200); nosound(); sound(600); delay(200); nosound(); sound(7); delay(200); nosound(); sound(600); delay(200); nosound(); sound(7);

delay(200); nosound(); sound(600); delay(200); nosound(); sound(7); delay(200); nosound(); sound(600); delay(200); nosound(); sound(7); delay(200); nosound() ; delay(1000); } }

//a function displaying the topic... void starting2() { clrscr(); int gdriver = DETECT; int gmode; int errorcode; initgraph(&gdriver, &gmode, "d:\\tc\\bgi\\");

settextstyle(1,0,5); outtextxy(250,100,"CRICKET "); settextstyle(1,0,5); outtextxy(110,200," MANAGEMENT SYSYTEM "); delay(2500); settextstyle(0,0,1); closegraph(); }

// a function to show end of project... void ending() { clrscr(); textcolor(YELLOW); int i; int j; for(j=13,i=20;j>-1,i<50;j--,i++) { delay(70); gotoxy(i,6); cputs(""); gotoxy(i,13); cputs(""); } for(j=13;j>6;j--)

{ delay(70); gotoxy(19,j); cputs(""); gotoxy(49,j); cputs(""); } gotoxy(19,6); cputs(""); gotoxy(49,6); cputs(""); gotoxy(19,13); cputs(""); gotoxy(49,13); cputs(""); gotoxy (20,7); cputs("THANK"); gotoxy (26,7); delay(250); cputs("YOU"); gotoxy (30,7); cputs("FOR"); delay(250); gotoxy(34,7); cputs("SEEING."); delay(250);

gotoxy(20,9); cputs("Hope you enjoyed. "); }

// a function to display the class... void middle1() { clrscr(); textbackground(BLACK); cout<<"a"; clrscr(); { clrscr(); int i; int j; textcolor(MAGENTA); for (i=2;i<24;i++) { delay(200); gotoxy(i,14); cputs(" gotoxy(i,16); cputs(" gotoxy(i,18); cputs(" gotoxy(i,20); BY "); PROJECT "); A COMPUTER ");

cputs(" if (i==22) {

CLASS XII

");

textcolor(10+BLINK); } if(i==23) { delay(5000); } } } }

//a functon to displaying name of teacher,whom the project is submitted... void middle2() { textbackground(BLUE); clrscr(); textcolor(GREEN); gotoxy(21,16); cputs("SUBMITTED TO :"); delay(1000); textcolor(MAGENTA); gotoxy(21,20); cputs(" delay(3000); Mr. SUDHIR GAUTAM ");

// a function to show developer of project... void middle3() { textbackground(BLACK); clrscr(); textcolor(GREEN); gotoxy(21,15); cputs(" MADE BY ........ ");

delay(2500); textcolor(MAGENTA); gotoxy(2,20); cputs(" HARSHITA NARANG");

gotoxy(2,22); cputs(" delay(700); textcolor(BROWN); gotoxy(20,20); cputs(" DEVENDER KUMAR "); 12th A ");

gotoxy(20,22); cputs(" delay(700); textcolor(CYAN); gotoxy(40,20); cputs(" HIMANSHU KHANDELWAL "); 12th A ");

gotoxy(40,22); cputs(" delay(2500); } 12th B ");

// a function to draw smiley... void smiley() { int gdriver = DETECT, gmode, errorcode; initgraph(&gdriver, &gmode, "d:\\tc\\bgi\\"); setfillstyle(1, YELLOW); fillellipse(200, 200, 50,50); setfillstyle(1, RED); fillellipse(180,190,5,5); fillellipse(220,190,5,5); setfillstyle(1, BLACK); fillellipse(200,210,3,6); setcolor(BLACK); arc(200, 220, 180, 0, 20); getch(); closegraph(); delay(1000); exit(0); }

//main function to call another function... void main() { int A; int selection; char choice1; char ans;

middle1(); middle2(); middle3(); starting1(); // starting2(); do { textbackground(BLUE); clrscr(); textcolor(BLACK); cout<<"a"; clrscr(); gotoxy(25,6); cputs(""); gotoxy(25,7); cputs(" gotoxy(25,8); INDEX ");

cputs(""); textcolor(MAGENTA); gotoxy(30,10); cputs("1. TO ADD A NEW PLAYER"); gotoxy(30,12); cputs("2. TO MODIFY A PLAYER"); gotoxy(30,14); cputs("3. TO DELETE A PLAYER"); gotoxy(30,16); cputs("4. TO SEARCH A PLAYER"); gotoxy(30,18); cputs("5. TO SEE DETAIL OF PLAYER"); gotoxy(30,20); cputs("6. TO DISPLAY THE LIST OF A TEAM"); gotoxy(30,22); cputs("7. ACKNOWLEDGEMENT"); gotoxy(30,24); cputs("8. EXIT "); gotoxy(30,26); cputs("ENTER YOUR SELECTION : "); cin>>selection; switch(selection) { case 1: textbackground(LIGHTGRAY); clrscr();

textcolor(BLUE); write(); break; case 2: textbackground(MAGENTA); clrscr(); textcolor(BLUE); modify(); break; case 3: textbackground(BLACK); clrscr(); textcolor(CYAN); dele(); break; case 4: textbackground(LIGHTGRAY); clrscr(); textcolor(BLACK); search(); break; case 5: textbackground(BLUE); clrscr(); textcolor(GREEN); read();

break; case 6: textbackground(BLACK); clrscr(); textcolor(MAGENTA); list(); break; case 7: ack(); break; case 8: ending(); smiley(); break; } textbackground(BLUE); textcolor(GREEN); gotoxy(22,35); cputs(" Do you wish to return to Index (Y/N)"); cin>>choice1; } while((choice1=='y')||(choice1=='Y')); clrscr(); delay(800); }

OUTPUTS
Main Screen

When Entered 1 in main screen

When choice =1

When choice=1

EntErED n

EntEr Y

EntEr 5

PrESS Y

PrESS 6

EntEr 1

EntEr 1

PrESS Y

PrESS 8

BIBLIOGRAPHY
IT WAS A NICE EXPERIENCE MAKING THIS PROJECT.

THE FOLLOWING HELPED ME IN COMPLETING THE PROJECT:

WEBSITE: WWW.GOOGLE.COM WWW.ICBSE.COM WWW.YAHOO.COM

BOOKS: COMPUTER SCIENCE C++ SUMITA ARORA

Das könnte Ihnen auch gefallen