You are on page 1of 1

COMP 1010 – Introduction to Programming

Fall 2022 Midterm Exam (Theory Part)


November 23, 2022 (3.45 – 4.45 PM)
Instructions:
1) The exam duration is 60 minutes (including 10 minutes of reading time) and is worth 30 points.
2) This booklet has six pages (including the cover page) with four questions.
3) Make sure your mobile phone is switched off and place it at the front with any bags, books, coats, etc.
4) Remember that talking is not allowed at any time in the exam hall. Please raise your hand if you have any
questions.
5) Write your answer in the space provided. YOU MUST WRITE YOUR ANSWER IN PEN (black or
blue ink). Answers written in pencil will not be marked.

First Name: ________________________


Question Score
Last Name: ________________________

Student ID: ________________________ 1


Major: ____________________________ 2
Room: _____________________________
3
I have read and understood the examination rules. I will
not cheat, copy from other students, or use unauthorized 4
materials or devices.

Total
SIGNATURE: _________________________

1. (12 pts.) Trace the following programs and write their outputs in the second column.

Code Outputs

# (example)
x = 8
y = -1
if x < 10: 8
print(x) Even Number
if x % 2 == 0: 7
print("Even Number")
if x + y > 0:
print(x + y)

You might also like