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 24 pages
Exam (elaborations)

CS 151 FINAL EXAM QUESTIONS AND ANSWERS. VERIFIED 2025/2026.

Document preview thumbnail
Preview 3 out of 24 pages

CS 151 FINAL EXAM QUESTIONS AND ANSWERS. VERIFIED 2025/2026.

Content preview

CS 151 FINAL EXAM QUESTIONS AND
ANSWERS. VERIFIED 2025/2026.




TF Instance variables and methods are called "class members". - ANS True



TF An "object" is the instance of its class - ANS True



Pick all true statements in OOP and Java:

1)"Method" in Java is equivalent to "attribute" in OOP.

2)"Method" in Java is equivalent to "behavior" in OOP.

3)"Instance variable" in Java is equivalent to "behavior" in OOP.

4)"Instance variable" in Java is equivalent to "attribute" in OOP. - ANS 2, 4



Pick all true statements in OOP.

1. We model the behavior of the real universe's entities with "Java Methods".

2. We model the behavior of the real universe's entities with "Java instance variables".

3. "Identity" of an object is the name we give to it.

4. We model the real universe's entities by "objects". - ANS 1,4



Definition of a class in OOP - ANS A class is an abstraction of similar objects.


1 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.

,Definition of a paradigm - ANS A paradigm is a way of representing an entity and its
interactions from the real world in the cyberspace.



Names of the 4 major paradigms in CS - ANS Procedural, Functional, OOP, and Logical



Definition of the state of an object - ANS Is the set of the values of the attributes at any
moment.



TF Dependency is a symmetric relationship. - ANS False



TF Software Development is a linear progression through some phases. - ANS False



TF The criteria for testing an application is its technical spec. - ANS False



TF The artifact of the design phase is called the functional spec. - ANS False



Pick all true statements about the problem statement:

1. It describes what the problem is

2. None is correct.

3. Theoretically, it is a clear description of the problem.

4. It is usually written by the client. - ANS 1,3,4



What is the multiplicity between the following classes in the given code?

A) CourseSection -- Instructor

B) CourseSection -- Student



2 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.

, public class CourseSection{

private List<Student> students;

private Instructor instructor;

//....

} - ANS A)1:1

B)1:*



ClassA aggregatres ClassB if... - ANS ClassA contains ClassB in its instance variables.



Pick all true statements about "classes relationship":

1. Aggregation is a special case of dependency

2. Dependency is a special case of aggregation

3. ClassA is dependent on ClassB if ClassA uses ClassB

4. Dependency and composition are totally different. - ANS 1,3



A) What does API stand for?

B) What is its definition? - ANS A) Application Programming Interface

B) Whatever a class (or library) exposes to the outside world. (Or can be seen by other classes).



What is the difference between aggregation and composition? - ANS Aggregation occurs
when ClassA uses ClassB in its instance variables. Composition occurs when ClassA uses ClassB
in its instance variables AND ClassB cannot exist independently outside of classA.



Give one reason for why we should minimize the dependency between classes? - ANS It
makes your code easier to maintain. Since classes are less dependent on one another, if you
change one class, a different class will not need to be changed since it is not concerned about
the changes made to the initial class.

3 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.

Document information

Uploaded on
December 7, 2025
Number of pages
24
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$12.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

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Brainbarter
3.6
(58)
Sold
363
Followers
159
Items
23019
Last sold
1 day 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