AP Computer Science 1.3 Program Development

AP Computer Science 1.3 Program Development. Which of the following is a correct declaration of one of the classes in the diagram?

APAP Computer Science
AP Computer ScienceProgram Development
Computer ScienceAP Computer Science
LanguageEnglish Language
Program AnalysisProgram correctness
Test PrepAP Computer Science

Transcript

00:17

inheritance relationship and a closed arrow to notes a composition

00:22

relationship So which of the following is a correct declaration

00:26

of one of the classes in the diagram Alright we'll

00:30

hear your potential answers Freedom freedom Think All right So

00:33

this question is about inheritance and composition relationship which could

00:37

be more easily thought of as is and has a

00:41

relationship But look at the diagram again Closed down arrows

00:45

show inheritance or is a relationship North american country is

00:49

a country Asian country is a country european Well these

00:55

classes are just more specific versions of the class they're

00:59

inheriting from then we have composition or has a relationship

01:03

represented by the up Arrow state has a north american

01:08

country It belongs to province and territory do too Okay

01:13

So back to the question at hand Which of the

01:15

potential answers is a correct declaration of the goings on

01:18

In a diagram well option a declares north american country

01:21

as an independent class Nice try jefferson but we're not

01:24

talking about the tyranny of king george We need to

01:27

declare north american country as a subclass of country if

01:31

we're following the diagram option b says state extends or

01:35

inherits from country which isn't correct according to the diagram

01:39

In fact it's outright saying that state is a country

01:42

and well known on it all our option c has

01:46

east asian country extends from asian country which is absolutely

01:50

true East asian country is an asian country d says

01:55

territory extends from north american country territory is a north

02:01

american country and e country extends from north american country

02:07

Not even soc is definitely our answer Anyone seen the

02:10

nail polish remover No i