Test and debug the program

Assignment Help Basic Computer Science
Reference no: EM132278152

Can you please Test and debug the program below using the following specifications? Many thanks!

Provide a list of valid entries and the correct results for each set of entries. Then, make sure that the results are correct when you test with these entries.

Provide a list of invalid entries. These should include entries that test the limits of the allowable values. Then, handle the invalid integers (such as negative integers and unreasonably large integers). In addition, make sure the user can't enter data that doesn't make sense (such as a player having more hits than at bats).

Don't attempt to handle invalid entries that cause exceptions, such as the user entering a string like "x" for an integer value. You can do that after you read chapter 8.

Tip: whenever needed please provide screenshots of your debugging. Thorough Test Plan also would be a BIG plus.

def display_menu():

  print("+"*50)

  print(" ttBaseball Team Manager")

  print("MENU OPTIONS")

  print("1 - Calculate batting average.")

  print("2 - Exit program.")

  print("+"*50)

def convertBat():

  print("Calculate batting average.")

  num_at_bats = int(input("Enter official number of at bats: "))

  num_hits = int(input("Enter number of hits: "))

  average = num_hits/num_at_bats

  print("Batting average:", round(average,3))

def main():

  while True:

    display_menu()

    rk = int(input("Menu Option : "))

    if (rk == 1):

      convertBat()

    elif(rk == 2):

      break

    else:

      print("Not a valid option. Please try again.")

  print("Bye!")

main()

Reference no: EM132278152

Questions Cloud

Provide a cost comparison for transporting a product : Discuss the role and significance of the water carrier industry in the global economy and, how the water carrier industry complements the other basic modes.
Which hash function is better : Consider the following two hash functions: h1(k) = k mod 6 and h2(k) = 3k mod 6 Which hash function is better? Justify your answer.
Indirect effects of the use of information technology : Discuss issues that are direct or indirect effects of the use of information technology:
Discuss the nature of costs in the railroad industry : Discuss the nature of costs in the railroad industry and how do they impact pricing decisions.
Test and debug the program : Can you please Test and debug the program below using the following specifications? Many thanks!
Discuss the critical issues in technology selection : Discuss the critical issues in technology selection and implementation. Search the Internet and provide an example of a company using technology to stay ahead.
Discuss the various methods used to measure supply chain : Discuss the various methods used to measure supply chain costs, service, profit and revenue.
Determining the hiding vs binding commitments : Bob is launching a new secure messaging app, BobCrypt. When Alice installs the app, it creates an account for her on the BobCrypt server
Developing a usability test questionnaire and your plan : For this assignment, you will be developing a usability test questionnaire and your plan for soliciting users to represent different user groups to participate.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Several systems analysis approaches

There are several systems analysis approaches for solving a business problem. Identify which method you would be most likely to use and state why.

  Everyone needs access to the internet

According to many, the digital world is being divided into 'haves' and 'have nots' - between those that have access and can use a computer and the Internet

  Permit system to control suggestion

One form of congestion avoidance is the permit system, in which a node must have a permit before it can transmit. Suppose a wide area network is using a permit system to control suggestion.

  The case structure is a selection structure

The CASE structure is a selection structure, however not all selection structures may be represented as CASE.

  Create short track using audiotool or another digital studio

For this assignment, you are required to create a short track using Audiotool.com or another digital studio. It can be in any style whatsoever... let your imagination go wild!

  Specific application or methodological study

In this six- to eight-page research paper, you will explore in detail one of the statistical approaches to research discussed in the course, applying it in the context of a specific application or methodological study.

  Kernel mode of windows nt-2000-xp operating system

What are the mechanisms of viruses, those works in kernel mode of Windows NT/2000/XP operating system?

  Find the difference in arts patronage from 1982 to 1992

Which areas saw the greatest increase and decrease in this time?. Which areas saw the greatest increase and decrease in this time?

  Determine the maximum height h in meters

Determine the maximum height h in meters to which the girl can walk up the slide without supporting herself by the rails or by her left leg.The coefficient of static friction between the girl's shoes and the slide is µS=0.8

  Implement an email strategy for its organization

A start-up company has hired you to implement an email strategy for its organization. The company wants all of its employees to have an enterprise-level

  Appropriate hardware and operating system

Name your business Decide what your email address will be Choose the most appropriate hardware and operating system

  Determine the specific impulse of this engine

Determine the specific impulse of this engine when the compressor pressure ratio is 9 and the temperature at the turbine inlet is 700°F.

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