Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 3 out of 17 pages
Exam (elaborations)

CPSC 1110 Final Exam with correct answers 2025

Document preview thumbnail
Preview 3 out of 17 pages

CPSC 1110 Final Exam with correct answers 2025

Content preview

CPSC 1110 Final Exam
with correct answers
2025/2026


All of its features are related to the concept that the class represents. - correct answersUnder
which of the following conditions would the public interface of a class be considered cohesive?



a) All of its features are public and none of its features are static.

b) All of its features are related to the concept that the class represents.

c) The quality of the public interface is related as moderate to high.

d) It is obvious that the public interface refers to multiple concepts.



A method and its caller. - correct answersPre- and postconditions may be viewed as a contract
between which of the following parties?



a) A method and its caller.

b) a class and its interface.

c) A method signature and its implementation.

d) An object and its class.

,If it is not met, the method is not responsible for computing the correct result. - correct
answersWhich of the following statements is true regarding the precondition of a method?



a) It is a suggestion to the caller of the method regarding method input values.

b) It guarantees the object will be in a certain state after the method call is completed.

c) If it is not met, the method is not responsible for computing the correct result.

d) It limits the potential data type of the parameter variables.



Dependency between classes. - correct answersWhat is coupling?



a) Coupling is an inconsistent design pattern

b) For every subclass, we have at most one superclass.

c) Dependency between classes.

d) Coupling suggests that a class will run slowly.



A guarantee that the object is in a certain state after the method call is complete. - correct
answersWhich of the following statements describes one aspect of a postcondition?



a) A logical condition in a program that you believe to be true.

b) A requirement that the caller of a method must meet.

c) A set of criteria defined by the caller of a method.

d) A guarantee that the object is in a certain state after the method call is complete.



A subclass may inherit methods and instances variables from its superclass, and may also
implement its own instance variables. - correct answersWhich of the following is true regarding
subclasses?

, a) A subclass that inherits methods from its superclass may not override the methods.

b) A subclass that inherits instance variables from its superclass may not declare additional
instance variables.

c) A subclass may inherit methods or instance variables from its superclass but not both.

d) A subclass may inherit methods and instances variables from its superclass, and may also
implement its own instance variables.



The subclass must simply use the name of the superclass instance variable. - correct
answersWhat must a subclass do to modify a protected superclass instance variable?



a) The subclass must simply use the name of the superclass instance variable.

b) The subclass must declare its own instance variable with the same name as the superclass
instance variable.

c) The subclass must use a public method of the superclass to update the superclass;s private
instance variable.

d) The subclass must have its own public method to update the superclass's protected instance
variable.



A subclass has no access to private instance variables of its superclass. - correct answersWhich
of the following is true regarding subclasses?



a) A subclass has access to private instance variables of its superclass.

b) A subclass has no access to private instance variables of its superclass.

c) A subclass does have access to public instance variables of its superclass.

d) A subclass must specify the implicit parameter to use methods inherited from its superclass.



The subclass's instance variable is said to shadow the superclass's variable. - correct answersIf a
superclass and a subclass both have an instance variable with the same name, which statement
is true?

Document information

Uploaded on
November 1, 2025
Number of pages
17
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$11.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
4
Followers
2
Items
902
Last sold
1 month ago


Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions