0% found this document useful (0 votes)
102 views6 pages

Course: CGSC 1005 A Facilitator: Samaia Aidroos

The document provides instructions for a mock exam for the CGSC 1005 A course, noting it should be completed in 1.5 hours under exam conditions. It provides details on take-up sessions to review the mock exam and contact information for the facilitator. Students are advised to use the mock exam to practice answering questions in a timed setting and to identify which course content they know well and which needs more review.

Uploaded by

Jules Lavoie
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views6 pages

Course: CGSC 1005 A Facilitator: Samaia Aidroos

The document provides instructions for a mock exam for the CGSC 1005 A course, noting it should be completed in 1.5 hours under exam conditions. It provides details on take-up sessions to review the mock exam and contact information for the facilitator. Students are advised to use the mock exam to practice answering questions in a timed setting and to identify which course content they know well and which needs more review.

Uploaded by

Jules Lavoie
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Course: CGSC 1005 A

Facilitator: Samaia Aidroos

CGSC 1005 A – MOCK EXAM (for PRACTICE only!)

It is most beneficial to you to write this mock final UNDER EXAM CONDITIONS. This means:  
1. Complete the midterm in 1.5 hours.  
2. Work on your own and attempt every question.  
3. Keep your notes and textbook closed.  
 
After the time limit, go back over your work with a different colour or on a separate piece of paper and
try to do the questions you are unsure of. Record your ideas in the margins to remind yourself of what you
were thinking when you take it up at PASS.  
The purpose of this mock exam is to give you practice answering questions in a timed setting and to help
you to gauge which aspects of the course content you know well and which are in need of further
development and review. Use this mock exam as a learning tool in preparing for the actual exam.  
Please note:  
 Complete the mock exam before attending the take-up session. During the session you can work
with other students to review your work.  
 
 Often, there is not enough time to review the entire exam in the PASS workshop. Decide which
questions you most want to review – the Facilitator may ask students to vote on which questions they
want to discuss in detail. 
 
 Facilitators will not distribute an answer key for mock exams. The Facilitator’s role is to help
students work together to compare and assess the answers they have. If you are not able to attend the
PASS workshop, you can work alone or with others in the class.  
 
 PASS worksheets are designed as a study aid only for use in PASS workshops. Worksheets may
contain errors, intentional or otherwise. It is up to the student to verify the information contained
within by attending the PASS workshop. 
 
Good Luck writing the Mock Exam!! 
Take-up Session #1:   
Friday, December 11th , 1:05pm – 2:25 pm
Take-up Session #2:   
Sunday, December 13th, 6:05 pm – 7:25pm
Office Hour #1:     
Friday, December 11th, 6:05pm – 6:55 pm
Office Hour #2:     
Monday, December 14th, 1:05pm – 1:55pm
Zoom Meeting Information: 
I will be emailing the Zoom meeting details (i.e. Zoom link, Meeting ID & Password) but it can also
be found on your course’s CuLearn page. 
Contact Information:  
[email protected]

 
 
Course: CGSC 1005 A
Facilitator: Samaia Aidroos

Part A - Multiple Choice (10 questions):

1. what would print: 6. what would print:

a) 5
a) January February January February
b) 6
b) 1 2 1 2
c) 7
c) January 1 February 2 January 2 February 1
d) 8
d) 1 1 2 2
2. What would print: 7. how do you create a file?

a) myfile.open(“test.txt”, “w”)

a) 10 15 20 25 30 next part b) myfile = open(“test.txt”, w)

b) 10 15 20 25 next part c) myfile = open(“test.txt”, “w”)

c) 10 30 5 next part d) myfile = open(test.txt, “w”)

d) 10 next part 15 next part 20 next part 25


next part
3. what would print: 8. A function call must have:

a) the same number of arguments as the definition


a) 0 1 2 3 4 b) the same order as the parameter list in the definition
b) 0 1 2 3 4 5 c) the arguments must be the correct data type
c) C a r l e d) all of the above
d) error
4. This function adds the list in place, the 9. ______ are defined inside the function and
original object is modified as well destroyed when the function ends, ________ are
defined outside the function
a) +
b) ascend a) local scope; global scope

c) * b) global scope; local scope


d) append c) inside scope; world scope

d) local scope; world scope


5. what would print: 10. what would print:
Course: CGSC 1005 A
Facilitator: Samaia Aidroos

a) [“banana”, “pear”, “peach”]


a) chocolate candy chips
b) 10 b) error

c) 15 c) [“banana”, “pear”, “peach”, “apple”]


d) 30
d) [“apple”]

Part B – Code Tracing (6 questions):

1. Explain in English what is happening in the following program (step by step):

2. Consider the above code (question 1). What would happen if the user entered password**3?

3. Consider the below code. What would print?


Course: CGSC 1005 A
Facilitator: Samaia Aidroos

4. consider the code from question 3 (above). What would happen if the 4 th line
changed to if a < maximum? If you changed that line, what other changes, if any, would you make?

5. Explain in English what is happening in the following code (algorithm):

6. consider the above code. What is the output?


Course: CGSC 1005 A
Facilitator: Samaia Aidroos

Part C – Writing a program (2 questions):

1. write an algorithm, then a program that:


o Reads from the list shoppinglist = [["fruit", "bread", "milk", "eggs"], ["soap", "paper towel"],
["lawn mower"]]
o Counts the number of elements in each sub list and sort them by:
o Food items
o Cleaning items
o Other items
o You should end up with a count of how many items fit into each category:
Course: CGSC 1005 A
Facilitator: Samaia Aidroos

2. Write an algorithm, and then a program that uses a function to remove the
duplicates from a list.

o Example: the list [10,20,30,20,10,50,60,40,80,50,40] becomes [10, 20, 30, 50, 60, 40, 80]

You might also like