Create a good design of the functions to make the best use

Assignment Help Computer Engineering
Reference no: EM1332307

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: EM1332307

Questions Cloud

Explain security be maintained in global e-commerce : Explain Security be maintained in global e-commerce and How can security be maintained in global e-commerce
How to write a python program : design a Python program that would prompt the user for the number of employees to be entered, and then prompt for employee name, followed by wage, followed by hours worked.
Expansionary fiscal policy : Using the material from the case assignment, would the implementation of a tariff be considered expansionary or contractionary fiscal policy? Explain.
Describe the process of organizational development : Prepare a paper in which you examine the concept of organizational development - describe the process of organizational development
Create a good design of the functions to make the best use : Write down 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. ..
Drivers to cash flow : Recognize two key drivers to cash flow. How do such drivers impact corporate value? Illustrate out the term market efficiency. Write down the name of some of ambiguities which are encountered in accounting on an accrual basis?
Impact of hurricane katrina on citizens : Discuss what steps that State and local officials might have taken early in the first days of Katrina.
Explain kohlberg''s trends and findings : Do you believe Kohlberg's trends and findings are credible and State whether you agree or disagree, and why
Evaluate a standard web hosting provider : How can a customer evaluate a standard web hosting provider?

Reviews

Write a Review

Computer Engineering Questions & Answers

  The cpu of a personal computer''s hardware

Discuss in detail \CPU of a personal computer's hardware, and define how the characteristics of that aspect affect overall computer performance.

  What is equation in java

What is equation in Java

  How to provide a cost-effective means of protection

What will be an appropiate outlined for this and provide a cost-effective means of protection.

  Describe software construction

Describe software construction

  Provide a java class named "input"

Provide a Java class named "Input" containing the method "readInt" (prototype given below) that displays the prompt string, reads an integer, and tests either it is between the supplied minimum and maximum. If not, it prints an error message and r..

  Write down a c++ program that first reads an integer

create a C++ program that first reads an integer for the array size, then reads numbers into an array, computes their average and finds out how many numbers are above the average.

  Work out the matrix dimension n automatically

Write down a C++ program that uses class Matrix for dealing with the square matrices (n x n tables of integers). The class constructor has to create a dynamic nxn matrix for n passed as a parameter.

  Security accounts manager

The security accounts manager (SAM) database consists of the information on all user profiles. User account set-up populates the database. Explain the fields and options linked with user account set-up.

  Program is re-written so it requires less memory

Cache misses are classified into one of three categories - compulsory, capacity, or conflict.

  Describes a function named insidecircle

Describes a function named insideCircle

  Create a testrectangle class in java

An overloaded constructor that takes integer width and height arguments, uses a separate method to check whether the width and height fall within the range between 0 and 30, and throws an exception if out of range.

  What are the advantages of this architecture

Reduced instruction set computers provide a large number of general-purpose registers and very few memory access instructions. Most instructions use registers instead of memory. What are the benefits of such architecture? Can you think of a disadv..

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