0% found this document useful (0 votes)
15 views28 pages

Final

Uploaded by

Soham Pawaskar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views28 pages

Final

Uploaded by

Soham Pawaskar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 28

THAKUR POLYTECHNIC

Diploma In Information Technology

THAKUR POLYTECHNIC
Diploma In Information Technology
THIRD SEMESTER [2023-24]
IF3I
GROUP-39
SUBJECT: Data Structure Using C (22317)

06 Harsh Chauhan
18 Garvit Kanani
19 Rishikesh Wagh
58 Soham Pawaskar

Guided By: Mr. Dhrupesh Savadia

CERTIFICATE
This is to certify that
1. Harsh Chauhan
2. Garvit Kanani
3. Rishikesh Wagh
4. Soham Pawaskar

Of THAKUR POLYTECHNIC (CODE: 0522) has completed the


micro-project satisfactorily in course Data Structure Using C (CODE:
22317) for the academic year 2023-2024 as prescribed in the
curriculum.
PLACE: Mumbai

Ms. Drupesh Savadia Mrs. Vaishali Rane Dr. S.M.Ganechari


Subject Teacher Head of Department Principal

Seal of institute

ACKNOWLEDGEMENT
We feel immense pleasure in submitting this report on ‘Cricket Score
Board’. While submitting this report, we avail this opportunity to express
our gratitude to all those who helped us in completing this task.

Heading the list with our own honourable Principal Dr. S.M. Ganechari
who is the beginner of our inspiration. We owe our deep gratitude and also
very thankful to our guide Mr. Sumit Parmar who has proved to be more
than just a mere guide to us. Apart from bringing to us what can be joy of
successful completion of this project was only possible due to her guidance
and co-operation without which this work would never have been
completed.

Finally, we wish to express our deep sense of respect and gratitude to each
and every staff member who has helped us in many ways and also our
parents who have always been with us in any critical situation and to all
others, sparing their time and helping us for completion of this project in
whatever way they could. And lastly we are grateful to each other the
members of our group.

THANK YOU
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
Certificate of Completion of Micro Project
This is to certify that the following group of students Roll no. 61 to 66 of 3rd
Semester of Diploma in COMPUTER ENGINEERING of institute, THAKUR
POLYTECHNIC (Code:0522) have successfully completed the MICRO PROJECT
satisfactorily in subject – Data Structure Using C (22317) for the academic year 2023-
2024 as prescribed in the curriculum.
ENROLLMENT NUMBER:
-----
------
------
------

PLACE: MUMBAI

Subject Teacher Head of Department Principal


[Mr. Sumit Parmar] [Mrs Suwarna Thakre] [Mr. S.M Ganechari]

Seal of the Institute


MICRO PROJECT
Micro-Project
PROPOSAL
Proposal

TITLE – Cricket Score Board

1.0 Aims/Benefits of the Micro-Project:


• They offer accurate and instant score updates.
• It provide detailed information such as player names, overs scored and run rates.
• It allow customization with logos and sponsor boards.
• They also increase visibility for both spectators and players
2.0 Course Outcomes Addressed:
✓ Simple ‘C’ programs.
✓ Develop ‘C’ programs using conditional operator.
✓ Develop ‘C’ programs using switch case.
✓ Develop/Use functions in C programs for modular programming approach.

3.0 Proposed Methodology:


In order to complete this micro-project of Data Structure Using C the procedure that
we will follow is given below.
• Data collection
• Coordination with necessary ethics
• Group Discussion
• References from Books and internet
• Execution
• Prepare Report
• Presentation
• Project submission

4.0 Action Plan:

Sr.No. Details of Planned start Planned Name of responsible


Activity date finish date team members
1. Information 12/10/2023 12/10/2023 Harsh Chauhan
search Garvit Kanani
Rishikesh Wagh
Soham Pawaskar
2. Group 13/08/2023 13/10/2023 Harsh Chauhan
Discussion
Garvit Kanani
Rishikesh Wagh
Soham Pawaskar
3. Taking reference 14/10/2023 14/10/2023 Garvit Kanani
Rishikesh Wagh
Soham Pawaskar
4. Executions 17/10/2023 17/10/2023 Garvit Kanani
5. Presentation and 08/11/2023 8/11/2023 Harsh Chauhan
report Garvit Kanani
submission
Rishikesh Wagh
Soham Pawaskar

5.0 Resources Required:

Sr Name of Specification Remarks


No Resources
material

1 Internet Chrome Available

2 Microsoft Microsoft office 2021 Available


Word

3 Turbo C Visual Studio Code Available

Name of Team Members with Roll No: (Group-11)


1. Harsh Chauhan 06
2. Garvit Kanani 18
3. Rishikesh Wagh 19
4. Soham Pawaskar 58

Guided By: Mr. Sumit Parmar


MICRO PROJECT
REPORT

1.0 Rationale:
C programming is a general-purpose, procedural, imperative computer programming
language developed in 1972 by Dennis M. Ritchie at the Bell Telephone Laboratories
to develop the UNIX operating system. C is the most widely used computer language.
It keeps fluctuating at number one scale of popularity along with Java programming
language, which is also equally popular and most widely used among modern software
programmers.

2.0 Aim/ Benefits of the Micro project:


• Delegate the roles and responsibilities.
• Share diverse perspectives.
• To make students aware about C Programming.
• To study the keywords, identifiers, variable, constants, if..else statements, loops
and input/outputs used in C Programming.
• To develop additional skills integral to the future, such as critical thinking and
time management.

3.0 Course Outcome Address:


• Write Simple ‘C’ programs using arithmetic expressions.
• Develop ‘C’ programs using control structure.
• Develop ‘C’ programs using arrays and structures.
• Develop/Use functions in C programs for modular programming approach.

4.0 Literature Review:


#include <stdio.h>
#include <stdlib.h>

void req_rate(float a, float b, float c,float d,float e);


void runs_needed(int a,int b,int c,int d, int e);
void projected_score(int a,int b,int c,int d,float e);
void result(int a,int b,int e,int g,char f,char c[],char d[]);
float curr_rate(float a, float b, float c);
void ball_played(int *a,int *b,int *c,int *d,int *e,int *f,int *g,int *h,int *i, int *j);
int string_comp(char a[],char b[],char c[]);
float curr_rate(float a, float b, float c);
int main(int argc, char *argv[]) {
int wd=0,nb=0,lb=0,b=0,extras=0,overs=0,T_overs=0, k=0,balls=0, T=0,score=0,wickets=0,
target=0,q=0,c[11],j=1,f=0,s=0;
float c_rate;
char toss[15], team_1[15], team_2[15], choice, runs;
printf("Match between:\n");
gets(team_1);
printf("versus\n");
gets(team_2);
printf("Toss won by: ");
gets(toss);
printf("Enter B to choose bat first and F to field first: ");
scanf("%c",&choice);
printf("Enter overs to be played by each side: ");
scanf("%d",&T_overs);
system("cls");
T=string_comp(team_1,team_2,toss);
while(overs<=T_overs||overs>=T_overs){
do{
if(wickets>q){
*(c+wickets)=score;
}
q=wickets;
system("cls");
printf("\t\t\t%s vs %s (%d-overs match)\n",team_1,team_2,T_overs);
if(T==1){
if(choice=='B'||choice=='b'){
printf("%s won the toss and elected to bat first\n",team_1);
printf("\n\n%s %d-%d\t\tovers %d.%d\t\
t",team_1,score,wickets,overs,balls);
}
else if(choice=='F'||choice=='f'){
printf("%s won the toss and elected to field first\n",team_1);
printf("\n\n%s %d-%d\t\tovers %d.%d\t\
t",team_2,score,wickets,overs,balls);
}
}
else if(T==2){
if(choice=='B'||choice=='b'){
printf("%s won the toss and elected to bat first\n",team_2);
printf("\n\n%s %d-%d\t\tovers %d.%d\t\
t",team_2,score,wickets,overs,balls);
}
else if(choice=='F'||choice=='f'){
printf("%s won the toss and elected to field first\n",team_2);
printf("\n\n%s %d-%d\t\tovers %d.%d\t\
t",team_1,score,wickets,overs,balls);
}
}
if (overs>0&&score>20){
if(overs==T_overs||wickets==10){
printf("\n");
k++;
break;
}
c_rate= curr_rate(score,overs,balls);
printf("run rate %0.2f\n",c_rate);
}
if(balls==0){
printf("\n");
if(extras>0){
printf("extras: %d(wd %d,nb %d,lb %d,b %d)\t",extras,wd,nb,lb,b);
}
if(f>0||s>0){
printf("boundaries: %d fours,%d sixes\n",f,s);
}
else
printf("\n");
}
if (overs>0&&score>20&&balls==0){
projected_score(score,overs,T_overs,balls,c_rate);
}
printf("\n");
if(overs==T_overs||wickets==10){
k++;
break;
}
ball_played(&balls,&score,&wickets,&extras,&wd,&nb,&lb,&b,&f,&s);
}while(balls<6);
if(balls==6){
balls=0;
}
if(overs<T_overs){
overs++;
}
if(k>0){
break;
}
}
printf("\nextras: %d(wd %d,nb %d,lb %d,b %d)\tboundaries: %d fours,%d sixes\
n",extras,wd,nb,lb,b,f,s);
if(wickets>0){
printf("\nfall of wickets: ");
for(j=1;j<=wickets;j++){
if(j==1||j==6)
printf("\n");
else
printf("\t");
printf("%d-%d",j,c[j]);
}
}
printf("\n\ninnings completed.");
sleep(10);
for(k=10;k>=0;k--){
system("cls");
printf("\n\n\n\n\t\t\tINNINGS BREAK...\n\t\t\t\t%d",k);
sleep(1);
}

target=score+1,score=0,overs=0,k=0,wd=0,nb=0,lb=0,b=0,balls=0,wickets=0,extras=0,j=1,q=0,f=0,s=0;
while(overs<=T_overs||overs>=T_overs){
do{
if(wickets>q){
*(c+wickets)=score;
}
q=wickets;
system("cls");
printf("\t\t\t%s vs %s (%d-overs match)\n",team_1,team_2,T_overs);
if(T==1){
if(choice=='B'||choice=='b'){
printf("%s gives target of %d runs to %s to win\
n",team_1,target,team_2);
printf("\n\n%s %d-%d\t overs %d.%d\
t",team_2,score,wickets,overs,balls);
}
else if(choice=='F'||choice=='f'){
printf("%s gives target of %d runs to %s to win\
n",team_2,target,team_1);
printf("\n\n%s %d-%d\t overs %d.%d\
t",team_1,score,wickets,overs,balls);
}
}
else if(T==2){
if(choice=='B'||choice=='b'){
printf("%s gives target of %d runs to %s to win\
n",team_2,target,team_1);
printf("\n\n%s %d-%d\t overs %d.%d\
t",team_1,score,wickets,overs,balls);
}
else if(choice=='F'||choice=='f'){
printf("%s gives target of %d runs to %s to win\
n",team_1,target,team_2);
printf("\n\n%s %d-%d\t overs %d.%d\
t",team_2,score,wickets,overs,balls);
}
}
if (overs>0&&score>20){
if(overs==T_overs||wickets==10||target<=score){
printf("\n");
k++;
break;
}
c_rate= curr_rate(score,overs,balls);
printf("run rate %0.2f",c_rate);
req_rate(score,overs,T_overs,balls,target);
}
if(balls==0){
printf("\n");
if(extras>0){
printf("extras: %d(wd %d,nb %d,lb %d,b %d)\t",extras,wd,nb,lb,b);
}
if(f>0||s>0){
printf("boundaries: %d fours,%d sixes\n",f,s);
}
else
printf("\n");
}
if (overs>0&&score>20){
runs_needed(score,overs,T_overs,balls,target);
}
printf("\n");
if(wickets==10||target<=score||overs==T_overs){
k++;
break;
}
ball_played(&balls,&score,&wickets,&extras,&wd,&nb,&lb,&b,&f,&s);
}while(balls<6&&overs<T_overs);
if(balls==6){
balls=0;
}
if(overs<T_overs){
overs++;
}
if(k>0){
break;
}
}
printf("\nextras: %d(wd %d,nb %d,lb %d,b %d)\tboundaries: %d fours,%d sixes\n",extras,wd,nb,lb,b,f,s);
if(wickets>0){
printf("\nfall of wickets: ");
for(j=1;j<=wickets;j++){
if(j==1||j==6)
printf("\n");
else
printf("\t");
printf("%d-%d",j,c[j]);
}
}
printf("\n\ninnings completed.");
sleep(10);
for(k=0;k<=7;k++){
system("cls");
sleep(1);
printf("\n\n\n");
result(target,score,T,wickets,choice,team_1,team_2);
sleep(1);
}
getche();
return 0;
}
float curr_rate(float a, float b, float c){
float d;
if (c==0)
d=a/b;
else
d=a/(b+(c/10));
return d;
}
int string_comp(char a[],char b[],char c[]){
int i=0,ab=0,j=0,k=0;
strupr(a);
strupr(b);
strupr(c);
for(i=0;i<3;i++){
if(a[i]==c[i])
j++;
else if(b[i]==c[i])
k++;
else
break;
}
if(j==3)
ab=1;
else if(k==3)
ab=2;
else
ab=0;
return ab;
}
void ball_played(int *a,int *b,int *c,int *d,int *e,int *f,int *g,int *h,int *i,int *j){
char runs;
int t;
scanf("%c",&runs);
switch(runs){
case '0':
*a=*a+1;
break;
case '1':
*b=*b+1;
*a=*a+1;
break;
case '2':
*b=*b+2;
*a=*a+1;
break;
case '3':
*b=*b+3;
*a=*a+1;
break;
case '4':
*b=*b+4;
*a=*a+1;
*i=*i+1;
break;
case '5':
*b=*b+5;
*a=*a+1;
break;
case '6':
*b=*b+6;
*a=*a+1;
*j=*j+1;
break;
case 'w':
case 'W':
printf("enter runs on wide ball: ");
scanf("%d",&t);
*b=*b+1+t;
*d=*d+1+t;
*e=*e+1+t;
break;
case 'n':
case 'N':
printf("enter runs on no ball: ");
scanf("%d",&t);
*b=*b+t+1;
*d=*d+1;
*f=*f+1;
break;
case 'l':
case 'L':
printf("enter runs as leg byes: ");
scanf("%d",&t);
*b=*b+t;
*a=*a+1;
*d=*d+t;
*g=*g+t;
break;
case 'b':
case 'B':
printf("enter runs as byes: ");
scanf("%d",&t);
*b=*b+t;
*a=*a+1;
*d=*d+t;
*h=*h+t;
break;
case 'o':
case 'O':
*a=*a+1;
*c=*c+1;
printf("enter runs if wicket is runout: ");
scanf("%d",&t);
*b=*b+t;
break;
}
}
void result(int a,int b,int e,int g,char f,char c[],char d[]){
int h,i;
h=(a-1)-b;
i=10-g;
if((a-1)==b){
printf("\t\t\tMATCH DRAWN.");
}
else if(a>b){
if(e==1){
if(f=='B'||f=='b')
printf("\t\t\t%s won by %d runs\n\t\t\tCONGRATULATIONS TEAM %s!",c,h,c);
else if(f=='F'||f=='f')
printf("\t\t\t%s won by %d runs\n\t\t\tCONGRATULATIONS TEAM %s!",d,h,d);
}
else if(e==2){
if(f=='B'||f=='b')
printf("\t\t\t%s won by %d runs\n\t\t\tCONGRATULATIONS TEAM %s!",d,h,d);
else if(f=='F'||f=='f')
printf("\t\t\t%s won by %d runs\n\t\t\tCONGRATULATIONS TEAM %s!",c,h,c);
}
}
else if(a<b||a==b){
if(e==1){
if(f=='B'||f=='b')
printf("\t\t\t%s won by %d wickets\n\t\t\tCONGRATULATIONS TEAM
%s!",d,i,d);
else if(f=='F'||f=='f')
printf("\t\t\t%s won by %d wickets\n\t\t\tCONGRATULATIONS TEAM
%s!",c,i,c);
}
else if(e==2){
if(f=='B'||f=='b')
printf("\t\t\t%s won by %d wickets\n\t\t\tCONGRATULATIONS TEAM
%s!",c,i,c);
else if(f=='F'||f=='f')
printf("\t\t\t%s won by %d wickets\n\t\t\tCONGRATULATIONS TEAM
%s!",d,i,d);
}
}
}
void projected_score(int a,int b,int c,int d,float e){
int ab,ba;
ab=(c-b)+(d/10);
ba=(ab*e)+a;
printf("\nPROJECTED SCORE:\n%d at %0.2f RPO(curr. rate)\n%d at 6 RPO\n%d at 8 RPO\n%d
at 10 RPO\n",ba,e,(ab*6)+a,(ab*8)+a,(ab*10)+a);
}
void runs_needed(int a,int b,int c,int d, int e){
int f,h;
f=(c*6)-((b*6)+d);
h=e-a;
printf("%d runs needed to win from %d balls",h,f);
}
void req_rate(float a, float b, float c,float d,float e){
float f,g,h,i;
f=e-a;
if(d==0){
h=c;
}
else{
h=(c-1)+0.6;
}
i=b+(d/10);
g=f/(h-i);
printf("\t req. run rate %0.2f\n",g);
}

Output:

1. All values will be taken by user.

2. Enter Runs, wicket etc

3. As innings over it there will be break.

4. Second inning
5. Results

Code Note:
1. Header File.
#include <stdio.h>
#include <stdlib.h>

2. Function Declaration.
Several functions are declared at the beginning of the code. These functions include:
req_rate: Calculates the required run rate.
3. Main Function:
The main function is where the program execution begins. It takes user input for
team names, toss result, choice of batting or fielding, and the number of overs etc
and displays the results.

4. Variable Declarations:
Various variables are declared in the main function, including integers and floating-
point numbers to store match-related data, such as scores, wickets, and run rates, and
character arrays to store team names and toss results.

5. Match Simulation Loop:


The code contains a loop that simulates the match, ball by ball. The loop keeps track
of overs, wickets, and scores. It calculates run rates and displays relevant statistics.
The loop continues until the match is over.

6. Functions Implementation:
The program uses the functions declared at the beginning to perform specific tasks.
For example, the curr_rate function calculates the current run rate, ball_played
records the runs scored on each ball, and result determines the outcome of the
match.

7. Outcome Display:
After the match simulation is complete, the program displays the match outcome,
including whether a team has won, lost, or the match ended in a draw.

8. Sleep Function:
The program uses the sleep function to introduce delays and display certain
messages with a time gap.

9. User Input and Output:


The program takes user input for team names, toss result, choice of batting or
fielding, and the number of overs, and it displays information related to the match,
scores, and statistics throughout the simulation.

10.String Comparison:
The string_comp function compares the input strings to determine which team won
the toss and selected batting or fielding

5.0 Actual Methodology Followed:


Once the micro project title was disclosed, the given topic was divided into smaller
subtopics which then were sent to all the group members. Once the group members
had received their subtopics, the team members researched their sub topic and sent
their respective data to the team group for everyone to read and understand. This data
was then be accumulated in a report and submitted to Mr.Drupesh Savadia for
correction.

6.0 Actual Resources Used:

Sr Name of Specification Remarks


No Resources
material

1 Internet Chrome Available

2 Microsoft Microsoft office 2021 Available


Word

3 Turbo C Visual studio Code Available

7.0 Outputs of the Micro Project:

• They offer accurate and instant score updates.


• It provide detailed information such as player names, overs scored and run rates.
• It allow customization with logos and sponsor boards.

8.0 Skill Developed/ Learning outcome of the Micro Project:


In the complete duration of the micro project, each member of the team member has
learned.
9.0 Applications of the Micro Project:

Name of Team Members with Roll No: (Group-39)


1. Harsh Chauhan 06
2. Garvit Kanani 18
3. Rishikesh Wagh 19
4. Soham Pawaskar 58

Guided By: Mr. Sumit Parmar

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy