Study Guides (380,000)
CA (150,000)
UTSC (10,000)
All (20)
Midterm

CSCA08 Term Test 1 Fall 2017Exam


Department
Computer Science
Course Code
CSCA08H3
Professor
All
Study Guide
Midterm

This preview shows pages 1-2. to view the full 8 pages of the document.
CSCA08 Fall 2017 Term Test #1
Duration — 110 minutes
Aids allowed: none
Student Number:
Markus Login:
Last Name: First Name:
Question 0. [1 mark]
Carefully read and follow all instructions on this page, and fill in all fields. Write all answers neatly in
the space provided, or indicate clearly where your question continues.
Please place a checkmark (X) beside your tutorial session
Tutorial Number Date/Time Room TA Name Check
TUT0001 FR 09:00 10:00 AA 208 David Liu
TUT0002 FR 10:00 11:00 IC 326 Kevin Gao
TUT0003 FR 13:00 14:00 BV 361 Meghan
TUT0004 FR 14:00 15:00 MW 160 Saurav
TUT0005 WE 19:00 20:00 HW 402 Mohammad
TUT0006 TH 10:00 11:00 IC 320 Pat
TUT0007 TU 09:00 10:00 AA 207 Prantar
TUT0008 TU 10:00 11:00 BV 355 William
TUT0009 TH 09:00 10:00 BV 260 Vladimir Efimov
TUT0010 WE 09:00 10:00 AA 204 Maheshan
TUT0011 WE 09:00 10:00 HW 308 Dharmik
TUT0012 TH 13:00 14:00 SW 319 Vincent
TUT0013 FR 13:00 14:00 HW 402 David Liu
TUT0014 TH 10:00 11:00 MW 170 Andrew
TUT0015 FR 11:00 12:00 IC 326 Siyang
TUT0017 TU 15:00 16:00 AA 208 Aiyaz
TUT0020 WE 11:00 12:00 BV 264 Eric
TUT0021 MO 11:00 12:00 HW 408 Ralph
TUT0022 MO 12:00 13:00 AA 207 Jason
TUT0023 FR 12:00 13:00 AA 204 Frank
TUT0025 TH 13:00 14:00 HW 408 Roleen
TUT0027 TU 11:00 12:00 BV 355 Keegan
TUT0029 TH 11:00 12:00 IC 120 Lucy
Do not turn this page until you have received the signal to start.
This exam consists of 3 questions on 8 pages (including this one). When you receive
the signal to start, please make sure that your copy is complete.
Proper documentation is required for all functions and code blocks. If you use
any space for rough work, indicate clearly what you want marked. Please read
all questions thoroughly before starting on any work. To receive full marks on
Question 0, draw a smiley face in the top right corner of this page.
The University of Toronto’s Code of Behaviour on Academic Matters applies to
all University of Toronto Scarborough students. The Code prohibits all forms of
academic dishonesty including, but not limited to, cheating, plagiarism, and the use
of unauthorized aids. Students violating the Code may be subject to penalties up
to and including suspension or expulsion from the University.
# 0: / 1
# 1: /25
# 2: /17
# 3: / 2
TOTAL:/45
Total Pages = 8 Page 1 cont’d. . .

Only pages 1-2 are available for preview. Some parts have been intentionally blurred.

CSC A08 Term Test #1 Fall 2017
[Use the space below for rough work. This page will not be marked unless you clearly indicate the part of
your work that you want us to mark.]
Student #: Page 2 of 8 cont’d. . .
You're Reading a Preview

Unlock to view full version

Only pages 1-2 are available for preview. Some parts have been intentionally blurred.

CSC A08 Term Test #1 Fall 2017
Question 1. [25 marks]
Write the output of the following code in the box on the right.
def func1(x):
print(x)
x=7
return x
def func2(x, y):
print(x + y)
z=x
x=y
y=z
print(str(x) + str(y))
return x * y
def func3(x, y, z):
print(func1(x))
print(func1(func2(y, z)))
z = func1(func1(x))
return x + y + z
a=3*3
b = 4.5 + 4.5
c = 9.0
print("--1--")
print(a, b, c)
print(str(a) + str(b) + str(c))
print(str(a + b + c))
print(a == b, a == c, a is b, a is c)
a=1
b=2
c=3
print("--2--")
c = func1(b)
print(a, b, c)
a = func2(b, c)
print(a, b, c)
c = func2(c, c)
print(a, b, c)
x=4
y=5
z=6
print("--3--")
r = func3(func1(x), func2(x, y), func2(func1(z), z))
Student #: Page 3 of 8 cont’d. . .
You're Reading a Preview

Unlock to view full version