• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 4 out of 130 pages
Exam (elaborations)

University of North Carolina — COMP 110 Introduction to Programming — Final Exam 150+ Practice Questions with Answers & Rationales

Document preview thumbnail
Preview 4 out of 130 pages

Topic Description Variables & Data Types Integers, floats, strings, booleans; type conversion; variable scope Conditionals If/else statements, logical operators, comparison operators Loops for loops, while loops, definite vs. indefinite iteration Functions Function definition, parameters, return values, scope Data Structures Lists, tuples, dictionaries, sets Classes & Objects Object-oriented programming, constructors, methods, magic methods Recursion Base cases, recursive cases, recursive data structures Algorithms Searching (linear, binary), sorting (bubble, merge, quick), algorithm analysis Testing Unit testing, assertions, test-driven development Ethics in Computing Social and ethical implications of software

Content preview

University of North Carolina — COMP
110 Introduction to Programming —
Final Exam
150+ Practice Questions with Answers &
Rationales

COURSE TOPICS COVERED
COMP 110 teaches fundamental programming concepts that
are applicable across programming languages. The course
covers:

Topic Description

Variables & Data Integers, floats, strings, booleans; type conversio
Types variable scope

If/else statements, logical operators, comparison
Conditionals
operators

,Topic Description

for loops, while loops, definite vs. indefinite
Loops
iteration

Function definition, parameters, return values,
Functions
scope

Data Structures Lists, tuples, dictionaries, sets

Object-oriented programming, constructors,
Classes & Objects
methods, magic methods

Base cases, recursive cases, recursive data
Recursion
structures

Searching (linear, binary), sorting (bubble, merge
Algorithms
quick), algorithm analysis

Testing Unit testing, assertions, test-driven development

Ethics in
Social and ethical implications of software
Computing

,PART I: VARIABLES, DATA TYPES & EXPRESSIONS (Questions
1-25)


1. What is the output of the following code?
python
x=5
y=2
print(x / y)
• A) 2
• B) 2.5
• C) 3
• D) 2.0
• E) Error
Answer: B
Rationale: In Python 3, the / operator performs floating-
point division, returning a float. = 2.5.


2. What is the output of the following code?
python

, x=5
y=2
print(x // y)
• A) 2
• B) 2.5
• C) 3
• D) 2.0
• E) Error
Answer: A
Rationale: The // operator performs integer (floor) division,
returning the quotient without the remainder. 5 // 2 = 2.


3. What is the output of the following code?
python
x=5
y=2
print(x % y)
• A) 0
• B) 1

Document information

Uploaded on
July 2, 2026
Number of pages
130
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$15.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.
MREXAMS
2.5
(4)
Sold
25
Followers
1
Items
979
Last sold
3 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