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

ECE 105 Programming for Engineers II - Final Exam Review (Qns & Ans) - DU 2025

Document preview thumbnail
Preview 3 out of 28 pages

ECE 105 Programming for Engineers II - Final Exam Review (Qns & Ans) - DU 2025ECE 105 Programming for Engineers II - Final Exam Review (Qns & Ans) - DU 2025ECE 105 Programming for Engineers II - Final Exam Review (Qns & Ans) - DU 2025

Content preview

ECE 105
Programming for Engineers II
Final Exam Review

(Questions & Solutions)

2025




1

, Section I – Multiple Choice (8 Questions)

Question 1:
Which of the following best describes the purpose of using decorators in
Python?
A. To improve runtime performance by compiling functions
B. To dynamically modify or enhance the behavior of functions or
methods without changing their code
C. To optimize memory usage in large-scale computations
D. To enforce strict data type checking at runtime

ANS: B
Rationale: Decorators are used to wrap a function, method, or class,
thereby extending or altering its behavior at runtime without modifying
its source code—a powerful tool for logging, access control, or caching.

---

Question 2:
In the context of scientific computing with Python, which library is most
commonly used for large-scale numerical operations on arrays and
matrices?
A. Matplotlib
B. NumPy
C. Pandas
D. SciPy

ANS: B
Rationale: NumPy provides a powerful N-dimensional array object and
a collection of routines for fast operations on arrays; it serves as the
foundational library for numerical computing and is extensively used in
engineering applications.


2

, ---

Question 3:
When designing an object-oriented program in Python for modeling an
engineering system, which feature allows for the creation of classes that
derive properties and behaviors from a parent class?
A. Encapsulation
B. Inheritance
C. Polymorphism
D. Abstraction

ANS: B
Rationale: Inheritance allows a class (or subclass) to derive attributes
and methods from a parent (base) class, promoting reusability and
hierarchical organization—a key concept in object-oriented design.

---

Question 4:
Which exception is raised in Python when a requested key is not found in
a dictionary?
A. IndexError
B. KeyError
C. NameError
D. ValueError

ANS: B
Rationale: A KeyError is raised when an operation or lookup in a
dictionary fails because the key is not present, allowing proper error
handling in programs that rely on dictionary data structures.

---

Question 5:
In Python’s memory management, what is the primary mechanism used
3

Document information

Uploaded on
June 18, 2025
Number of pages
28
Written in
2024/2025
Type
Exam (elaborations)
Contains
Unknown
$18.49

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.
ClementeBSC
4.0
(3)
Sold
13
Followers
7
Items
3975
Last sold
7 months 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