Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Write a function update Batsman that takes the outcome of a ball and the batsman’s state, and returns the batsman’s updated state. ballOutcomes # test batsman playerScoreBoard(updateBatsman("run0",...

1 answer below »
Write a functionupdate Batsman that takes the outcome of a ball and the batsman’s state, and returns the batsman’s updated state. ballOutcomes # test batsman playerScoreBoard(updateBatsman("run0", playerA), header = TRUE) Name 0s 1s 2s 3s 5s X Out Tot T Smith XXXXXXXXXXplayerScoreBoard(updateBatsman("run1", playerA)) T Smith XXXXXXXXXXplayerScoreBoard(updateBatsman("out", playerA)) T Smith XXXXXXXXXXplayerScoreBoard(updateBatsman("illegal", playerA)) T Smith XXXXXXXXXX # test bowler playerScoreBoard(updateBowler("run0", playerA)) T Smith XXXXXXXXXXplayerScoreBoard(updateBowler("run5", playerA)) T Smith XXXXXXXXXXplayerScoreBoard(updateBowler("illegal", playerA)) T Smith XXXXXXXXXX
Answered 75 days After May 23, 2022

Solution

Aditi answered on Aug 06 2022
77 Votes
ASSIGNMENT
#include#includestruct 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 bowle
{
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 {
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);
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 {
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);
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here