13
SR. NO TOPIC PAGE NO. TEACHER’S SIGN 1 2 CERTIFICATE ACKNOWLEDGEMENT iii iv 3 4 ABOUT THE PROJECT PROGRAM v v 5 6 OUTPUT SCREENSHOTS BIBLIOGRAPHY xii xiv

C++ Project For Class 12(Cricket) Final

Embed Size (px)

DESCRIPTION

ICT Management System

Citation preview

Page 1: C++ Project For Class 12(Cricket) Final

SR.

NO

TOPIC PAGE NO. TEACHER’S

SIGN

1

2

CERTIFICATE

ACKNOWLEDGEMENT

iii

iv

3

4

ABOUT THE PROJECT

PROGRAM

v

v

5

6

OUTPUT SCREENSHOTS

BIBLIOGRAPHY

xii

xiv

Page 2: C++ Project For Class 12(Cricket) Final

This is to certify that Anuj Gupta, of Class XII B, Roll No. 5, has successfully completed the project work titled

'ICT Management System'

And that this project is the record of authentic work carried out during the academic year (2015-2016). He has completed the project work under computer department under direct supervision of undersigned as per the requirement of The Board Examination.

Student’s Sign Teacher’s Sign

External’s Sign Principal’s Sign

Page 3: C++ Project For Class 12(Cricket) Final

I would like to express my special thanks of gratitude to my

Computer Science teacher Mrs. Deepti Sahu as well as our

Principal Mrs. Bharti Bhagwani, for their vital support,

guidance and encouragement - without which this project would

not have come forth. They also gave me the golden opportunity to

do this wonderful project which helped me in doing a lot of

Research. I am really thankful to them.

Page 4: C++ Project For Class 12(Cricket) Final

This project uses the concept of data file handling and other concepts of “object oriented programming”. Its Aim is to collect various vital data about players like runs scored, average, centuries etc. This project helps to store data in a very compact easily accessible way instead of storing data in huge bulks of files.

********************************************* // ICT Management System

//Version 1.0 Beta release(Updated) //Developed by:

#include<iostream.h>

#include<conio.h> #include<stdio.h>

struct data

{ int sno;

char name[20]; float avg; // Average

int runs;

int cent; // Centuary int wic; // Wickets

float avg2; }b[20],c,d;

void menu2(int n);

void question(int n);

//___________________________________________________________________________

Page 5: C++ Project For Class 12(Cricket) Final

//___________________________________________________________________________

void sort(int n)

{ int tmp,small,pos;

for(int l=1;l<=n;l++)

{ small=b[l].sno;

pos=l; for(int k=l+1;k<=n;k++ )

{ if(b[k].sno<small)

{

small=b[k].sno; pos=k;

} }

d=b[l];

b[l]=b[pos]; b[pos]=d;

} }

//___________________________________________________________________________ //___________________________________________________________________________

void enter(int n) // Function to input Cricketers info

{ clrscr();

cout<<" *=*=*=*=*=*=*=*=*=*=*=|ICT MANAGEMENT SYSTEM|*=*=*=*=*=*=*=*=*=*=*";

cout<<"\n\n\t\tEnter the details of the selected players:";

for(int i=1;i<=n;i++) {

cout<<"\n\tS No."; cin>>b[i].sno;

cout<<endl<<"\n\tNAME:";

gets(b[i].name); cout<<endl<<"\n\tRUNS SCORED:";

cin>>b[i].runs; cout<<"\n\tCENTURIES:";

cin>>b[i].cent; cout<<endl<<"\n\tBATTING AVERAGE:";

cin>>b[i].avg;

cout<<"\n\tWICKETS:"; cin>>b[i].wic;

cout<<endl<<"\n\tBOWLING AVERAGE:"; cin>>b[i].avg2;

cout<<" \n*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*";}

menu2(n); }

//___________________________________________________________________________ //___________________________________________________________________________

void display(int n) // Function to display Selected players {

sort(n);

cout<<" \n*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*\n"; cout<<"\t\tLIST OF INDIAN PLAYERS:";

for(int i=1;i<=n;i++)

Page 6: C++ Project For Class 12(Cricket) Final

{

cout<<"\n\tS No."<<b[i].sno<<endl; cout<<"\tNAME:"<<b[i].name;

} question(n);

}

//___________________________________________________________________________ //___________________________________________________________________________

void details(int n) // Function to view details {

clrscr(); sort(n);

int x;

cout<<" \n*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*"; cout<<"\n\tDETAILS OF WHICH PLAYER(SNo.) DO U WANNA SEE:";

cin>>x; cout<<"\n\tS No.\t"<<b[x].sno<<endl;

cout<<"\n\tNAME:\t"<<b[x].name<<endl<<"\n\tRUNS SCORED:\t"<<b[x].runs;

cout<<"\n\n\tCENTURIES:\t"<<b[x].cent<<"\n\n\tBATTING AVERAGE:\t"<<b[x].avg; cout<<"\n\n\tWICKETS:\t"<<b[x].wic<<"\n\n\tBOWLING AVERAGE\t"<<b[x].avg2;

question(n); }

//___________________________________________________________________________ //___________________________________________________________________________

rank1(int n) // Function to sort players according to their batting average

{

clrscr(); cout<<" \n*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*\n";

cout<<"\n\n\t\tBATTING RANKINGS:";

int tmp,small,pos,p=1; for(int l=1;l<=n;l++)

{ small=b[l].avg;

pos=l;

for(int k=l+1;k<=n;k++ ) {

if(b[k].avg<small) {

small=b[k].avg; pos=k;

}

} c=b[l];

b[l]=b[pos]; b[pos]=c;

}

for(int i=n;i>=1;i--) {

cout<<"\n\n\t"<<p<<b[i].name<<endl; p++;

} question(n);

return 0;

} //___________________________________________________________________________

//___________________________________________________________________________

Page 7: C++ Project For Class 12(Cricket) Final

rank2(int n) // Function to sort players according to their bowling average

{ clrscr();

cout<<" \n*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*\n"; cout<<"\n\n\t\tBOWLING RANKINGS:";

int tmp,small,pos,p=1;

for(int l=1;l<=n;l++) {

small=b[l].avg2; pos=l;

for(int k=l+1;k<=n;k++ ) {

if(b[k].avg2<small)

{ small=b[k].avg2;

pos=k; }

}

c=b[l]; b[l]=b[pos];

b[pos]=c; }

for(int i=1;i<=n;i++)

{

cout<<"\n\n\t"<<p<<b[i].name<<endl; p++;

} question(n);

return 0;

} //___________________________________________________________________________

//___________________________________________________________________________ void rank(int n) // Function to view ranks

{

clrscr(); int y;

cout<<" \n*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*"; cout<<"\t\tWHICH RANKINGS DO U WANT TO SEE:";

cout<<"\n\n\n\tEnter 1 for batting rankings:"; cout<<"\n\tEnter 2 for bowling rankings:";

cout<<"\n\n\n\tEnter your choice:";

cin>>y; switch(y)

{ case 1:rank1(n);

case 2:rank2(n);

} }

//___________________________________________________________________________ //___________________________________________________________________________

del(int n) // Function to delete a player {

clrscr();

sort(n); int g;

cout<<"Enter the sno of the player u want to drop:";

Page 8: C++ Project For Class 12(Cricket) Final

cin>>g;

for(int i=g;i<=n;i++) {

b[i]=b[i+1]; }

int f,m;

m=n-1; cout<<" \n*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*";

cout<<"\n\tDo u want to see the list of players again"; cout<<"\n\n\tpress 1 to see \n\tpress 2 if u dont ";

cout<<"\n\tpress 3 to delete another record"; cin>>f;

switch(f)

{ case 1:display(m);

case 2:question(n); case 3:del(m);

}

} //___________________________________________________________________________

//___________________________________________________________________________ void update(int n) // Function to update players info

{ sort(n);

cout<<" \n*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*\n";

cout<<"Which player's(sno) details do u want to update"; int t;

cin>>t; cout<<"\n Following are the details of player chosen\n\n";

cout<<"\n\n\tS No.\t"<<b[t].sno<<endl;

cout<<"\tNAME:\t"<<b[t].name<<"\n\tRUNS SCORED:\t"<<b[t].runs; cout<<"\n\tCENTURIES:\t"<<b[t].cent<<"\n\tBATTING AVERAGE:\t"<<b[t].avg;

cout<<"\n\tWICKETS:\t"<<b[t].wic<<"\n\tBOWLING AVERAGE:\t"<<b[t].avg2; cout<<"\n\n\t\tEnter the new records:";

cout<<"\n\n\t\tNAME:\t";

gets(b[t].name); cout<<"\n\t\tRUNS SCORED:\t";

cin>>b[t].runs; cout<<"\n\t\tCENTURIES:\t";

cin>>b[t].cent; cout<<"\n\t\tAVERAGE:\t";

cin>>b[t].avg;

cout<<"\n\t\tBOWLING AVERAGE:\t"; cin>>b[t].avg2;

cout<<"\n\t\tWICKETS:\t"; cin>>b[t].wic;

question(n);

} //___________________________________________________________________________

//___________________________________________________________________________ void menu2(int n) // Function to display menu

{ clrscr();

int a;

cout<<" *=*=*=*=*=*=*=*=*=*=*=|ICT MANAGEMENT SYSTEM|*=*=*=*=*=*=*=*=*=*=*";

cout<<"\n\n\n\t 1.Enter 1 to see the list of all team members";

Page 9: C++ Project For Class 12(Cricket) Final

cout<<"\n\t 2.Enter 2 to see the details of a player";

cout<<"\n\t 3.Enter 3 to see the rankings"; cout<<"\n\t 4.Enter 4 to delete a Player";

cout<<"\n\t 5.Enter 5 update a players details"; cout<<"\n\t 6.Enter 6 to exit";

cout<<"\n\n\n\n\t Enter your choice:";

cin>>a; switch(a)

{ case 1:display(n);

break; case 2:details(n);

break;

case 3:rank(n); break;

case 4:del(n); case 5:update(n);

case 6:break;

default:cout<<"\n\n\t\twrong choice"; }

getch(); }

//___________________________________________________________________________ //___________________________________________________________________________

void menu1()

{ clrscr();

int s; // Function to display menu cout<<" *=*=*=*=*=*=*=*=*=*=*=|WELCOME TO ICT MANAGEMENT

SYSTEM|*=*=*=*=*=*=*=*=*=*=*";

cout<<"\n\nEnter the number of selected players:"; cin>>s;

cout<<"\n\nPress any key to Continue"; getch();

enter(s);

getch(); }

//___________________________________________________________________________ //___________________________________________________________________________

void question(int n) // Function to display menu {

cout<<"\n\n\n";

int e; cout<<" \n*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*";

cout<<"\n\tEnter 1 for returning to the menu."; cout<<"\n\tEnter 2 to exit.";

cout<<" \n*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*";

cout<<"\n\n\tEnter your choice :"; cin>>e;

switch(e) {

case 1:menu2(n); case 2:cout<<" Thank you ";

break;

} }

//___________________________________________________________________________

Page 10: C++ Project For Class 12(Cricket) Final

//___________________________________________________________________________

void main() {

menu1(); }

//___________________________________________________________________________

//___________________________________________________________________________

Page 11: C++ Project For Class 12(Cricket) Final
Page 12: C++ Project For Class 12(Cricket) Final
Page 13: C++ Project For Class 12(Cricket) Final

For our project we have taken help from following sources

1) COMPUTER SCIENCE WITH C++ BY SUMITA ARORA

2) INTERNET - CRICKET.YAHOO.COM