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

COMPUTER PROGRAMMING EXAM QUESTIONS AND ANSWERS 2025

Rating
-
Sold
-
Pages
38
Grade
A+
Uploaded on
22-05-2025
Written in
2024/2025

COMPUTER PROGRAMMING EXAM QUESTIONS AND ANSWERS 2025

Institution
COMPUTER PROGRAMMING
Course
COMPUTER PROGRAMMING

Content preview

COMPUTER LATEST
PROGRAMMING EXAM
ANSWER ALL QUESTIONS IN THIS SECTION



QUESTION 1



Which of the following is correct?



A) a parent class is a subclass of its child

B) a base class is a child class or derived class

C) a base class is a parent class or super class

D) a child class is a super class of its parent

E) None of these are correct - ANSWERS-C



QUESTION 2



An int array stores the following values: 9, 4, 12, 2, 6, 8,



Which of the following lists of numbers would accurately show the array after the
third pass of

the selection sort algorithm?



END OF
PAGE
1

, COMPUTER LATEST
PROGRAMMING EXAM
A) 9, 4, 12, 2, 6, 8, 18

B) 2, 4, 6, 9, 8, 12, 18

C) 2, 4, 12, 9, 6, 8, 18

D) 2, 4, 6, 9, 12, 8, 18

E) 2, 4, 9, 12, 6, 8, 18 - ANSWERS-D



QUESTION 3



Polymorphism is achieved by



A) overloading

B) overriding

C) embedding

D) abstraction

E) encapsulation - ANSWERS-B




END OF
PAGE
2

, COMPUTER LATEST
PROGRAMMING EXAM
QUESTION 4



Assume that Student, Employee and Retired are all extended classes of Person, and
all

four classes have different implementations of the method getMoney. Consider the
following code

where . . . indicates the required parameters for the constructors:



Person p = new Person(...);

int m1 = p.getMoney();

p = new Student(...);

int m2 = p.getMoney();

if (m2 < 100000) p = new Employee(...);

else if (m1 > 50000) p = new Retired(...);

int m3 = p.getMoney(); // assignment 3

The reference to getMoney() in assignment 3 is to the class



A) Person

B) Student

C) Employee

END OF
PAGE
3

, COMPUTER LATEST
PROGRAMMING EXAM
D) Retired

E) This cannot be determined by

examining the code - ANSWERS-E



QUESTION 6



What class hierarchy involving classes L, M, and N would make the following
code valid?



L l; M m; N n;

l = new M(); l = new N(); m = new N();



A) Classes M and N must both be subclasses of class L.

B) Class M must be a subclass of class N, which is a subclass of class L.

C) Class N must be a subclass of class M, which is a subclass of class L.

D) Classes L must be a subclass of class M and also a subclass of class N.

E) There is no class hierarchy that would allow this code. - ANSWERS-C




END OF
PAGE
4

Written for

Institution
COMPUTER PROGRAMMING
Course
COMPUTER PROGRAMMING

Document information

Uploaded on
May 22, 2025
Number of pages
38
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$18.49
Get access to the full document:

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

Get to know the seller

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.
Teacher101 Teachme2-tutor
Follow You need to be logged in order to follow users or courses
Sold
488
Member since
2 year
Number of followers
74
Documents
10721
Last sold
2 days ago

Quality is my middle name.....100% ...my policy is to create and nurture people of quality by continuous education and training.....i guaranteed good grades 100% Feel free to get in touch through inbox...anything regarding help or issue with the exams posted... Finally after purchase please leave a good rating if satisfied with my work.... All the best as we continue working to improve ourselves through education

4.6

276 reviews

5
224
4
15
3
26
2
3
1
8

Recently viewed by you

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