Program that will first ask the number of overs each team

Assignment Help Programming Languages
Reference no: EM13935909

In a limited over cricket match Team A is taking on Team B. Team A is batting first.

Write a Python program that will first ask the number of overs each team will bat. The program then will continue to ask the score board people to input the runs for every ball for Team A until the team gets all out or they run out of overs. Do NOT prompt a message like "Enter runs :" for each ball.

Each over has just six balls, and you do not need to worry about extra balls due to No Balls, Wide etc in this program. Also you do not need to worry about multiple things happening for a ball. For example, you do not need to consider cases where a team gets runs and at the same time loses a wicket for the same ball. For one ball only one thing will be happening.
The program should display a running total score for the team. When the loop finishes the program should display the total score, number of wickets lost, and the number of overs played by Team A.

The program then should do the same for Team B. When the loop finishes for Team B the program should display the total scores, number of wickets lost and number of overs played by both teams. An extra termination condition of the loop for Team B will be if the running total score of Team B exceeds the total score of Team A.

The program will also display the winning team and the result. That is, if Team A wins then it will display the result in terms of runs. For example, Team A wins by 54 runs, which is the difference between the total runs scored by the teams. However, if Team B wins then the program will display the result in terms of wickets. For example, Team B wins by 3 wickets.

The program will need to keep track of number of balls played, and number of wickets lost by a team. Use multiple functions, instead of using only one function to do everything. Make a good design of the functions to make the best use of the code and avoid duplicate calculations.

Reference no: EM13935909

Questions Cloud

What will the spot rate be in one year according to the ife : The one-year interest rate is 11% in the United Kingdom and 7% in Singapore. What will the spot rate be in one year according to the IFE?
Analyse the leadership of a 21st century : Using relevant theories and models critically evaluate and analyse the leadership of a 21st century leader of a organisation.
Derive forecasts of the future spot rate : Deriving forecasts of the future spot rate. Use the forward rate to forecast the percentage change in the Mexican peso over the next year.
Does variable costing profit present a more realistic : Does variable costing profit present a more realistic view of firm performance in the two years?Explain.
Program that will first ask the number of overs each team : The program will also display the winning team and the result. That is, if Team A wins then it will display the result in terms of runs. For example, Team A wins by 54 runs, which is the difference between the total runs scored by the teams. Howev..
Why are antibacterials not used to destroy viruses : Why are antibacterials not used to destroy viruses? What is the difference between bacteria and viruses that cause this to happen. Why is the blood brain barrier considered both good and bad?
Evaluation of the leader by referring to concepts : An evaluation of the leader by referring to concepts and theories covered in the subject (e.g. style, behaviour, traits, attitudes, power) and by referring to relevant examples and mini-cases in the textbook (where appropriate).
What islamic modes of finance underpin the qatar sukuk : Describe the exact nature of the Qatar Sukuk. What Islamic modes of finance underpin the Qatar Sukuk? Describe how these modes of finance work and the exact relationship they have with he Qatar Sukuk
How does an organism with a capsule such as k. pneumoniae : How does an organism with a capsule such as K. pneumoniae, provide the organism with pathogenic abilities to avoid destruction by the host cell?

Reviews

Write a Review

Programming Languages Questions & Answers

  Program to take input five numbers-display mean average

Write the program which takes as input five numbers and outputs mean average and standard deviation of numbers. If numbers are x1, x2 ,x3, x4, and x5, then mean is?

  Write a program that simulates an airplane race

Write a program that simulates an airplane race. The program will display a table showing the speed in km/hour and distance in km traveled by two airplanes every second until one of them has gone 10 kilometers.

  Create-implement program which creates exception

Create and implement a program which creates an exception class called StringTooLongException, designed to be thrown when string is discovered that has too many characters in it.

  Method to pass string argument and returns first line

Write a method, getFirstLine, that is passed a String argument and that returns the first line.

  Write program that would estimate magnitude

Write a program that would estimate the magnitude (liters/day) and cost of the water saved based on the community's population.

  Write down script to report cumulative size of all files

Write down script which will report cumulative size of all files in and below given directory. Your script will also report name and size (in bytes) of largest file with that directory tree.

  Write application layer protocols to permit through firewall

As part of your own planning process, write the application layer protocols which you would permit through the firewall, those you would block and your reasons for doing so.

  Design algorithm to will read file and produce weekly report

Design an algorithm that will read file and produce a weekly report of the net earnings for those employees. Net earnings are gross earnings minus deductions.

  Determine maths function in sql

Calculate the average salary for employees for each state.

  Program compares the number entered to the previous number

The program compares the number entered to the previous number. In the event that it is a duplicate number, the user will be prompted to enter a different number. Display the number to the screen as long as it is not a duplicate.

  Perform object-oriented analysis and design

OOAD's increasing popularity is brought about in part because of its ability to represent complex relationships, as well as data and data processing, with a consistent notation.

  Program to accept each worker-s first and last names

A program which continuouly accepts each worker's first and last names, this year's number of units produced, and last year's number of units produced. Show each employee with a message.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd