C language Write a program that reflect the cricket game by taking input of two teams having three players of each team (i.e. teamA, teamB). You need to decide which team is winner by generating score of each player using rand function. Player will be marked as out if he scored 7 on a ball delivery. Use functions to maintain program flow.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 44SA
icon
Related questions
Question

C language

Write a program that reflect the cricket game by taking input of two teams having three players of each team (i.e. teamA, teamB). You need to decide which team is winner by generating score of each player using rand function. Player will be marked as out if he scored 7 on a ball delivery. Use functions to maintain program flow.

 

Guidelines:

  1. Use single dimensional array of each team of size three to store the score of players.
  2. Create a user defined function of batting_inning (int teamA[3]) to execute the game. Use limit of three to five overs of six ball. Once the batting inning of a team get over, it should aggregate the team score into one variable i.e. team_score.
  3. Use rand () function to generate random score.
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage