fin120.html, Last updated: Sunday 2nd December 2018, 6:40 PT, AD

CSCI120 - Final Exam


/*********************************************************************/



This document is subject to change.  

REFRESH THIS PAGE OFTEN FOR LATEST VERSION



/*********************************************************************/


In accordance with college regulations, 
students with less than 50% attendance on the course
will not be allowed to take the final exam.

Your participation and progress are monitored throughout the course.

You may inspect your status report at any time using the online Gradebook

Final exam dates are posted on the Coquitlam College website.

In accordance with college regulations, 
no final grades are posted online in the Gradebook or sent by email.
Your final grades are posted on the Student Portal.




Final exam revision topics are posted on the final exam study guide.

***   The final exam is a 2 hour written exam.   ***

The final exam is closed-book and closed-notes.

The final exam is worth 35% of the final grade. 


Students must attain an overall passing grade on
the weighted average of exams in the course 
in order to obtain a clear pass (C or better).


You may be asked questions on any of the topics covered
in the course.

Students may be tested in a quiz or an exam
on the content of team or individual assignments.


The final exam will be composed of a mix of questions:

Part 1 (20 points) of the exam is composed of:

20 multiple choice or true/false questions worth 20 points in total.

Part 2 (10 points) of the exam is composed of:

10 predict the output of programs questions worth 10 points in total.

Part 3 (36 points) of the exam is composed of:

three written programming questions worth 36 points in total.



----------------------------------------------------------------------------

Example predict the output questions:






1.  What is the output of this Python program?

x = 17 / 2 % 2 * 3**3
print (x)
 

Answer:

13.5





 
2.  What is the output of this Python program?

print (7 > 10)
print (4 < 16) 
print (4 == 4) 
print (4 <= 4)  
print (4 != 4)  



Answer: 

False
True
True
True
False


 

3.  What is the output of this Python program?


num1 = 5
if num1 >= 91:
    num2 = 3
else:
    if num1 < 6:
        num2 = 4
    else:
        num2 = 2
x = num2 * num1 + 1
print (x,x%7)



Answer: 
21     0







4. Name and give an example of the three types of error
that might be contained in a Python program.

Answer:

syntax error - mis-spelling a keyword
logic error - multiplying when you meant to divide
run-time - an attempt to divide by zero




5. What is an algorithm?


Answer: a written description of the steps to solve a problem.



6. What is a computer program?

Answer: the implementation of an algorithm



7. What is the data type of a value such as 3.142?

Answer: float



8. What is the data type of a value such as 3?

Answer: int



9. What is the data type of a value such as "anne was here"?

Answer: string



10.  What is the output when the following code is executed?

list1 = [2,4,6,8,10,12,14,16,18,20] 
print (list1[0:1],list1[5:7])

Answer:
[2] [12, 14]








11.  What is the output when the following code is executed?

list1 = [1,2,3]
list1 = list1 * 2
print (list1)

Answer:
[1, 2, 3, 1, 2, 3]







12.  What is the output when the following code is executed?

s1 = 'spamandeggs'
x = s1.find('and')
print (x)
print (s1[0:1],s1[5:7])

Answer:
4 
s nd








13.  What is the output when the following code is executed?

s = 'one\ntwo\tthree'
print (s)
print (len(s))

Answer:
one
two	three 
13







14.  What is the output when the following code is executed?

list2 = ["B","C","A"]
list2.extend(["X","Y"]) 
list2.reverse()
list2.append("S")
list2.sort() 
list2.reverse()
print (list2)

Answer:
['Y', 'X', 'S', 'C', 'B', 'A']



15. What is the output when the following code is executed?

f = open("x.txt","w") 
f.write("Where did\nI put my\nloaf\nof bread") 
f.close() 
f = open("x.txt","r") 
string = f.readline()
string = f.readline()
str1 = string.strip()
print(str1)
string = f.readline()
str2 = string.strip()
print(str2)
f.read(4)
string = f.readline()
str3 = string.strip()
print(str3)
print(str2.upper())
print(len(str1))


Answer:

I put my
loaf
read
LOAF
8

-----------------------------------------------------------------------------

The Participation score is worth a total of 15% of the final grade,
and is based on your participation in the course.
Participation is measured by attendance / student activity on the C4 system, 
submission of assignments and performance on the team project.

-----------------------------------------------------------------------------



Your participation and progress are monitored throughout the course.

You may inspect your status report at any time using the online Gradebook

Final exam dates are posted on the Coquitlam College website.

In accordance with college regulations, 
no final grades are posted online in the Gradebook or sent by email.
Your final grades are posted on the Student Portal.


/************************************************************/

Good Luck!

/************************************************************/
 

End of document

 


		

Valid HTML5! Valid CSS!