AP Computer Science 4.1 Classes and Objects
Recommendation
Want a study guide too?
AP Computer Science 4.1 Classes and Objects. Which of the answers is the best definition of a postcondition?
AP | AP Computer Science |
AP Computer Science | Classes and Objects |
Computer Science | AP Computer Science |
Language | English Language |
Object-Oriented Program Design | Program and Class Design |
Test Prep | AP Computer Science |
Transcript
flavours All right we'll write up the bat we can
eliminate answer c We know that a post condition has
to do something with the aftermath of a situation We
know this from the latin root post Meaning after or
behind a post condition is an assertion about a piece
of code What should be true at the end of
it not necessarily what is true By the end we'll
post conditions are not always met Do tow bugs and
logic errors take a real life example You should always
follow the speed limit but no one actually does In
other words close conditions tell you what the code segment
is meant to achieve not what it actually achieves So
now let's Take a look at answer b d Any
differences air subtle but are important Answering the question well
he is talking about the output of the program referencing
console output that's usually produced by a code segment And
he references the actual effect of the code segment like
the variables it modifies and the actions it's completed All
right well we can see that be accurately describes our
definition of a post condition A statement of what should
be true after the code segment is run of such
a shame that everyone is fuming over the high cost 00:01:32.008 --> [endTime] of gas these days