Ask Question
23 March, 17:18

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.

+4
Answers (1)
  1. 23 March, 17:27
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers