Cricket Score Management System in C with Source Code

Cricket Score Management System in C with Source Code

This Cricket Score Management System Project in C Language is a simple console application created using C programming language. It employs file handling to store data such as runs, wickets, overs, and extras, among other things. The program may show runs, wickets, batsman and bowler names, overs, extras, bowler economy, batsman strike rate, and so on. It also shows the game’s start and end times.

Anyway if you want level up your knowledge in programming especially C/C++ Programming Language, try this new article I’ve made for you Best C Projects with Source Code for Beginners Free Download 2020.

To run this Cricket Score Management in C make sure that you have a Code Blocks or any platform of C installed in your computer. Please scroll down and click the download button to obtain a free copy of the Cricket Score Management project.

ABOUT PROJECTPROJECT DETAILS
Project Name : Cricket Score Management System
Project Platform :C/C++
Programming Language Used:C Programming Language
Developer Name :itsourcecode.com
IDE Tool (Recommended):Dev-C++/Codeblocks
Project Type :Desktop Application
Database:Stores data in .DAT file
Upload Date and Time:July 27, 2021- 3:44 am
Cricket Score Management System in C with Source Code Information

Cricket Score Management System in C Steps On How To Run The Project

Time needed: 5 minutes.

Here’s the step’s on how to run a  Cricket Score Management System in C with Source Code.

  • Step 1: Extract file.

    Next, after you finished download the source code, extract the zip file.
    Extract file for Cricket Score Management System in C with Source Code

  • Step 2: Open CodeBlocks

    After that, After extracting the zip file, open your “CodeBlocks IDE”.
    Open Code blocks Apps for Extract file for Matchstick game in C with Source Code

  • Step 3: Open Project.

    Then, open file tab and Open File after that open folder RRS-IN-C then click the “main“.

  • Step 4: Run Project

    Lastly, Open build tab and select build and run or you can use key F9.

  • Step 5: The actual code.

    Finally, You are free to copy the given source code below or download the downloadable source code given.

This Cricket Score Management System in C was build and run under Code::Blocks IDE.

  • The project begins by displaying the welcome screen, which fades up to reveal the main menu.
 delay_timer(1000);
gotoxy(37+25,9);printf("\t\t!!!WELCOME!!!");
delay_timer(1000);
gotoxy(43+25,10);printf("{+}\t\t\t{+}");
gotoxy(53+25,10);printf("TO");
delay_timer(1000);
gotoxy(42+25,12);printf("%c\t\t\t %c",178,178);
gotoxy(44+25,12);printf("!CRICKET SCORE SYSTEM!");
delay_timer(1000);
printf("\n\n");
  • There are three options on the main menu: First: New Scoresheet, Second: Existing Scoresheet and the Last:Exit
printf ("\n\n\t\tCHOOSE ANY ACTION:\n");
    printf("\t\t1.NEW SCORESHEET!!\n\t\t2.EXISTING SCORESHEET!!\n\t\t3.EXIT!!\n");
  • If ‘1′ is entered, the Cricket Score Sheet project prompts for a new score sheet’s name. A message appears on the screen when the file is created.
printf("\n\t\t\tEnter the bowler name:");
        gets(tempname);
        for(h=0;h<=z;h++)
        {
            if(strcmp(tempname,game.bowler[h].name)==0)
                goto atish;
        }
       strcpy(game.bowler[z].name,tempname);
        h=z;
        z++;
  • Function to Taking the overs and further calculation
char tempname[20];
    int nt;
    fflush(stdin);
    printf("\t\t\tEnter the number of overs:");
    scanf("%d",&nt); 
  • Function to Saving the data to the file
FILE *fptr;                                            
fptr=fopen("cricbuz.DAT","rb+");
if(fptr==NULL)
{
    fptr=fopen("cricbuz.DAT","wb+");
    if(fptr==NULL)
    {
        puts("Cannot open file");
    }
}
  • The function to input the match information
void welocme_message2()
{                                              
    fflush(stdin);
    printf("\n\n\t\tEnter the match name:");
    gets(game.name);
    printf("\n\t\tEnter venue:");
    gets(game.venue);
    printf("\n\n\t\tEnter batting team name:");
    gets(game.teambat);
    printf("\n\t\tEnter balling team name:");
    gets(game.teambowl);
}
  • Function to input the players name
void players_hero()  
{

    int i;
    printf("\n\n\t\t\t%cTEAM SQUAD%c",175,174);
    printf("\n\n\t\t\t%cEnter the names of players of team %s:\n",190,game.teambat);
    for(i=0;i<11;i++)
    {
        printf("\t\t\tplayer %d:",i+1);
        gets(game.bat[i].playersFname);
    }
}
  • These functions are for changing the strike
void smaller_number()
{
    int temp=b;

    b+=(nb-b);                                 
    nb-=(nb-temp);
}
  • These are functions for time and for proper displaying of the datas on the console
void delay_timer(unsigned int mseconds)
{                                                             
   clock_t time;
   time=mseconds +clock();
   while(time>clock());

}
  • Function to Displays the score in each over
void card_game(int *z,int *bats)   
{
    int i;
    printf("\n\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");
   printf("\t\t|BATSMAN\t\tRUNS\tBALLS\tSTRIKE RATE\t4S\t6S|\n");
   printf("\t\t|-----------------------------------------------------------------|\n");
   for(i=0;i<*bats;i++){

     printf("\t\t|%-23s%d\t%d\t%1.2f\t\t%d\t%d |\n",game.bat[i].playersFname,game.bat[i].runningBatsMan,game.bat[i].runningBall,game.bat[i].strike,game.bat[i].fours,game.bat[i].sixes);
   }
   printf("\t\t|-----------------------------------------------------------------|\n\t\t|TEAMRUN:%d\t\tRUNRATE:%f\tEXTRARUN:%-4d     |\n\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n",game.teamrun,game.runrate,game.extra);
   printf("\n\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");
    printf("\t\t|BOWLER\t\t\tRUNS\tECONOMY\t  WICKETS\t NOBALL\t  WIDE\t  |\n");
    printf("\t\t|-----------------------------------------------------------------|\n");
    for(i=0;i<*z;i++){

     printf("\t\t|%-23s%d\t%1.2f\t  %-4d\t %-6d\t   %d\t  |\n",game.bowler[i].name,game.bowler[i].run,game.bowler[i].economy,game.bowler[i].wickets,game.bowler[i].nob,game.bowler[i].wd);
   }
   printf("\t\t|-----------------------------------------------------------------|\n\t\t|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\n");

}

Downloadable Source Code

Conclusion

This Cricket Score Management System in C with Source Code is only a project made for school requirement purposes only. A Cricket Score Management System in C language was created specifically for a semester project. It aims to give beginners a good understanding of programming small to large projects by imparting general workable and practical information about C. You can download this program and modify it to suit your client requirements, since this is a student project it means you cannot really expect 100% functionality from this.

Inquiries

If you have any questions or suggestions about  Cricket Score Management System in C with Source Code, please feel free to leave a comment below.

Leave a Comment