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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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