Ask Question
14 August, 06:49

Section 6.9 of your textbook ("Debugging") lists three possibilities to consider if a function is not working. Describe each possibility in your own words. Define "precondition" and "postcondition" as part of your description. Create your own example of each possibility in Python code. List the code for each example, along with sample output from trying to run it.

+3
Answers (1)
  1. 14 August, 10:45
    0
    If a function is not working, there are three possibilities to consider: There is something wrong with the arguments the function is getting; a precondition is violated. There is something wrong with the function; a postcondition is violated. There is something wrong with the return value or the way it is being used.

    a. precondition

    A precondition is a prerequisite. It's the thing that has to happen before something else happens ... When it's a verb, precondition means to prepare something (or someone).

    b) a postcondition

    A postcondition is the states the system can be in after the use case has ended. Consider the following: The states described by pre - or postconditions should be states that the user can observe. "The user has logged on to the system" or "The user has opened the document" are examples of observable states.

    c) As in any programming language, "return value" means the value that is returned by any sub-routine. All subroutines need not return values, sometimes return void (means nothing). Return values often indicate something about the completion of the task or result of an operation.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Section 6.9 of your textbook ("Debugging") lists three possibilities to consider if a function is not working. Describe each possibility in ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers