AP Computer Science 4.1 Classes and Objects

AP Computer Science 4.1 Classes and Objects. Which of the answers is the best definition of a postcondition?

APAP Computer Science
AP Computer ScienceClasses and Objects
Computer ScienceAP Computer Science
LanguageEnglish Language
Object-Oriented Program DesignProgram and Class Design
Test PrepAP Computer Science

Transcript

00:20

flavours All right we'll write up the bat we can

00:23

eliminate answer c We know that a post condition has

00:26

to do something with the aftermath of a situation We

00:29

know this from the latin root post Meaning after or

00:32

behind a post condition is an assertion about a piece

00:36

of code What should be true at the end of

00:39

it not necessarily what is true By the end we'll

00:42

post conditions are not always met Do tow bugs and

00:45

logic errors take a real life example You should always

00:48

follow the speed limit but no one actually does In

00:54

other words close conditions tell you what the code segment

00:57

is meant to achieve not what it actually achieves So

01:01

now let's Take a look at answer b d Any

01:03

differences air subtle but are important Answering the question well

01:06

he is talking about the output of the program referencing

01:09

console output that's usually produced by a code segment And

01:13

he references the actual effect of the code segment like

01:15

the variables it modifies and the actions it's completed All

01:20

right well we can see that be accurately describes our

01:22

definition of a post condition A statement of what should

01:25

be true after the code segment is run of such

01:29

a shame that everyone is fuming over the high cost 00:01:32.008 --> [endTime] of gas these days