Project Based Learning Report
On
“Cricket scoreboard”
Submitted in the partial fulfillment of the requirements
For the Project based learning in (Computation and
Programming Using C)
In
Electronics & Communication Engineering
By
2314110488 Dipanshu Saikia
2314110426 Deepesh Kumar Choudhary
2314110433 Suraj Bhatt
Under the guidance of Course In-charge
Prof. APARNA PATIL
Department of Electronics & Communication
Engineering
Bharati Vidyapeeth
(Deemed to be University)
College of Engineering, Pune – 4110043
(Academic Year: 2023-24)
1
Bharati Vidyapeeth
(Deemed to be University)
College of Engineering, Pune – 4110043
DEPARTMENT OF ELECTRONICS &
COMMUNICATION ENGINEERING
CERTIFICATE
Certified that the Project Based Learning report entitled, “Cricket Scoreboard” is
done by
2314110426 Deepesh Kumar Choudhary
2314110433 Suraj Bhatt
2314110488 Dipanshu saikia
in partial fulfillment of the requirements for the award of credits for Project
Based Learning (PBL) in Computation and Programming Using C of
Bachelor of Technology Semester I, in Electronics and Communication.
Date: /10/2023
Prof. Aparna Patil Dr. Arundhati A.Shinde
Course In-charge
2
ACKNOWLEDGEMENT
We would like to express our gratitude and appreciation to all who
allowed us to complete this report. Special thanks are due to our
Principal Dr. Vidula Sohoni, HOD Dr. Arundhati A Shinde and our
guide, Prof. Aparna Patil who gave stimulating suggestions and
encouragement during helped us in the time of fabrication process
and in writing this report. We also sincerely thank our faculty of the
CP for correcting our mistakes whenever we did to make it successful
for us to complete this project.
We would also like to acknowledge with much appreciation the
crucial role of the staff in the CP Lab who permitted us to use the lab
equipment and machinery & permitting us to use all the necessary
tools in the laboratory.
3
INDEX
SR. No. Tittle PAGE NO.
1. Introduction 5
2. Source code 6-10
3. output 11-12
4. conclusion 13
4
Introduction
Cricket is a popular sport enjoyed by millions around the
world. Keeping track of the scores in a cricket match is
essential for players, fans, and statisticians.
This C program is designed to serve as a basic cricket
scoreboard, allowing user to input the scores of two cricket
teams and displaying the total score for each team along with
the details of the player, overs played or bowls played and
other statistics.
5
SOURCE CODE
#include<stdio.h>
#include<stdlib.h>
struct batsman
{
char name[25];
int runs,score,balls,toruns,tobal,ones,twos,threes,fours,sixes;
int max_six,max_run,max_four;
float str;
}pl1[100],pl3;
struct bowler
{
char name[25];
int runsgv,wkttkn,overs;
int max_w;
float econ;
}pl2[100],pl4;
int main()
{
int plno,choice;
int i,n,m;
printf("Enter the Batsman detail:\n");
printf("Enter the number of batsman:\n");
scanf("%d",&m);
for(i=0;i<m;i++)
{
printf("Enter name of batsman%d:\n",i+1);
scanf("%s",pl1[i].name);
printf("Enter the number of ones scored by player%d:\n ",i+1);
scanf("%d",&pl1[i].ones);
printf("Enter the number of twos scored by player%d:\n ",i+1);
scanf("%d",&pl1[i].twos);
printf("Enter the number of threes scored by player%d:\n ",i+1);
scanf("%d",&pl1[i].threes);
printf("Enter the number of fours scored by player%d:\n ",i+1);
6
scanf("%d",&pl1[i].fours);
printf("Enter the number of sixes scored by player%d:\n ",i+1);
scanf("%d",&pl1[i].sixes);
printf("Enter the balls played by the player%d:\n",i+1);
scanf("%d",&pl1[i].balls);
}
printf("\nEnter the bowlers details:\n");
printf("Enter the number of bowlers:\n");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("\nEnter name of bowler%d:",i+1);
scanf("%s",pl2[i].name);
printf("Enter the runs given by the bowler%d:\n ",i+1);
scanf("%d",&pl2[i].runsgv);
printf("Enter the overs bowled by the bowler%d:\n",i+1);
scanf("%d",&pl2[i].overs);
printf("Enter the wickets taken by the bowler%d\n",i+1);
scanf("%d",&pl2[i].wkttkn);
printf("Thank you all details are recorded\n");
do
{
printf("Enter the choice:\n 1)Batsman detail:\n 2)Bowlers detail:\n 3)Match summary:\n 4)Record:\n 5)Exit\n ");
scanf("%d",&choice);
switch(choice)
{
case 1:
7
printf("Enter the batsman number to see his details\n");
scanf("%d",&plno);
plno--;
printf(" Player Detail\n");
printf("===========================================================================\n");
printf(" Batsman runs balls fours sixes sr \n");
printf("===========================================================================\n");
pl1[plno].runs=(1*pl1[plno].ones)+(2*pl1[plno].twos)+(3*pl1[plno].threes)+(4*pl1[plno].fours)+(6*pl1[plno].sixes);
pl1[plno].str=(pl1[plno].runs*100.00)/pl1[plno].balls;
printf(" %-15s %-14d %-13d %-11d %-11d %-
9.2f\n\n",pl1[plno].name,pl1[plno].runs,pl1[plno].balls,pl1[plno].fours,pl1[plno].sixes,pl1[plno].str);
break;
case 2:
printf("Enter the bowlers number to see his details\n");
scanf("%d",&plno);
plno--;
printf(" Player Detail\n ");
printf("=================================================================\n");
printf(" Bowler overs runs wicket economy\n");
printf("=================================================================\n");
pl2[plno].econ=pl2[plno].runsgv/pl2[plno].overs;
printf(" %-15s %-14d %-13d %-11d %-
11.2f\n\n",pl2[plno].name,pl2[plno].overs,pl2[plno].runsgv,pl2[plno].wkttkn,pl2[plno].econ);
break;
case 3:
printf(" Match summary\n");
printf("==========================================================================\n");
printf(" Batsman runs balls fours sixes sr \n");
printf("==========================================================================\n");
for(i=0;i<m;i++)
{
pl1[i].runs=(1*pl1[i].ones)+(2*pl1[i].twos)+(3*pl1[i].threes)+(4*pl1[i].fours)+(6*pl1[i].sixes);
pl3.toruns+=pl1[i].runs;
pl1[i].str=(pl1[i].runs*100.00)/pl1[i].balls;
printf(" %-15s %-14d %-13d %-11d %-11d %-
9.2f\n\n",pl1[i].name,pl1[i].runs,pl1[i].balls,pl1[i].fours,pl1[i].sixes,pl1[i].str);
}
8
printf("TOTAL RUNS:%d\n\n",pl3.toruns);
printf("\n\n");
printf("=================================================================\n");
printf(" Bowler overs runs wicket economy\n");
printf("=================================================================\n");
for(i=0;i<n;i++)
{ pl2[i].econ=pl2[i].runsgv/pl2[i].overs;
printf(" %-15s %-14d %-13d %-11d %-
11.2f\n\n\n",pl2[i].name,pl2[i].overs,pl2[i].runsgv,pl2[i].wkttkn,pl2[i].econ);
}
break;
case 4: pl3.max_run=0,pl4.max_w=0,pl3.max_four=0,pl3.max_six=0;
for(i=0;i<m;i++)
{
pl1[i].runs=(1*pl1[i].ones)+(2*pl1[i].twos)+(3*pl1[i].threes)+(4*pl1[i].fours)+(6*pl1[i].sixes);
if(pl3.max_run<pl1[i].runs)
{
pl3.max_run=pl1[i].runs;
if(pl3.max_six<pl1[i].sixes)
{
pl3.max_six=pl1[i].sixes;
}
if(pl3.max_four<pl1[i].fours)
{
pl3.max_four=pl1[i].fours;
}
if(pl4.max_w<pl2[i].wkttkn)
{
pl4.max_w=pl2[i].wkttkn;
}
}
printf("Highest runs scored by the batsman:%d\n",pl3.max_run);
printf("Maximum fours scored by the batsman:%d\n",pl3.max_four);
printf("Maximum sixes scored by the batsman:%d\n",pl3.max_six);
printf("Maximum wickets taken by the bowler:%d\n",pl4.max_w);
break;
9
case 5:
exit(1);
default:
printf("Enter the correct choice\n");
break;
}while(choice!=5);
return 0;
10
Output
1.Batsman’s details
2.Bowler’s details
11
3.Match summary
4.Records & 5. Exit
12
Conclusion
In Conclusion, the cricket scoreboard program in C is a
practical and educational project that provides a foundation
for building a simple tool to track cricket match scores.
This program allows the user to input the scores for each
player (Number of runs made by every player, number of
balls played, number of wickets taken by the bowler, etc.) in
2 teams. The code calculates and can show Batsman’s details,
Bowler’s details, Match summary, Records.
This Project is not only a valuable learning experience for
programmers but also a practical tool for cricket enthusiasts,
coaches and statisticians who want to keep track of cricket
match scores efficiently.
13