Ask Question
24 July, 08:15

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.

+2
Answers (1)
  1. 24 July, 09:56
    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?
Get 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 & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers