VERSION 00000001

COMPSCI 111/111G

THE UNIVERSITY OF AUCKLAND
SUMMER SEMESTER, 2015
Campus: CityCOMPUTER SCIENCEAn Introduction to Practical Computing(Time Allowed: TWO HOURS)NOTE:You must answer all questions in this exam.
No calculators are permitted
Answer Section A (Multiple choice questions) on the Teleform answer sheet provided.
Answer Section B in the space provided in this booklet.
There is space at the back for answers that overflow the allotted space.
SurnameForenames
Student ID
Login (UPI)
Question

MarkOut Of

1 - 25Multiple Choice

5026

Programming using Python

1027

Spreadsheets

1028

Databases

1029

LaTeX

1030

XHTML and CSS

10TOTAL100

CONTINUED

VERSION 00000001-2-COMPSCI 111/111G

SECTION A
MULTIPLE CHOICE QUESTIONSEach question in this section is worth 2 marks. There is only one correct answer for eachquestion. For each question, choose the best answer according to the information presented
in lectures. Select your preferred answer on the Teleform answer sheet provided by shadingin the appropriate box.
Question 1[2 marks] Imagine 4 switches, each able to show 0 or 1. How many different values (orstates) can be represented by the 4 switches?
(a) 1111(b) 3(c) 8(d) 18(e) 16

Question 2[2 marks] Which one of the following decimal numbers is equal to the binary number1011101?
(a) 93(b) 186(c) 103(d) 46(e) 67

Question 3[2 marks] How do the ARM processors often used in mobile devices compare to the Intelprocessors commonly used in desktop, laptop and server computers?
(a) ARM processors commonly include secondary storage.
(b) ARM processors use a reduced set of instructions.
(c) ARM processors are more powerful but also have a higher power consumption.
(d) ARM processors have a larger number of CPU cores.
(e) ARM processors allow the inclusion of extension cards which Intel processors do not.

Question 4[2 marks] What does the abbreviation RAID stand for?
(a) Redundant Array of Inexpensive Disks.
(b) Redundant Arrangement for Invaluable Data.
(c) Red Alert Instant Drive.
(d) Reclusive Array of Illegal Drives.
(e) Relayed Arrangement of Interconnected Disks.

CONTINUED

VERSION 00000001-3-

COMPSCI 111/111G

Question 5[2 marks] Which of the following is NOT an example of freeware?
(a) Skype.
(b) Adobe Reader.
(c) Internet Explorer.
(d) Microsoft Office.
(e) Apple iTunes.

Question 6[2 marks] Which of the following statements about software is FALSE?
(a) Open source software may legally be copied.
(b) Any software that can be downloaded free of charge may be legally copied anddistributed to others.
(c) Computer software is a creative work that is covered by copyright law.
(d) Shareware is a type of proprietary software.
(e) Some proprietary software is available free of charge.
Question 7[2 marks] Which historical/political event provided the investments in technology which
eventually gave rise to the Internet?
(a) The Depression.
(b) World War II.
(c) The Space Race.
(d) The Global Financial Crisis.
(e) The Cold War.

Question 8[2 marks] Which of the following is the most important protocol for communication over theInternet?
(a) IMAP(b) TCP/IP(c) FTP(d) UDP(e) POP3

CONTINUED

VERSION 00000001-4-COMPSCI 111/111G

Question 9[2 marks] What does the @ sign represent in an email address?
(a) The separation of the DNS from the IP address.
(b) The separation of the local part of the address from the IP address.
(c) The separation of the IP address from the mail server domain name.
(d) The separation of the user's password from the mail server domain name.
(e) The separation of the local part of the address from the mail server domainname.
Question 10[2 marks] Which one of the following statements about wikis is FALSE?
(a) Wiki pages can be locked by moderators to prevent vandalism.
(b) A wiki is designed to allow people to collaborate easily.
(c) Each wiki page has an associated page that allows discussion of the page content.
(d) The first wiki was created by Tim Berners-Lee.
(e) Every change that is made to a wiki page is logged and can be viewed in a history list.

Question 11[2 marks] With regard to the URL"http://yourblog.co.nz/stefan_w/index.html", in what order do theelements of the URL appear?
(a) protocol, domain, path, file name(b) path, protocol, file name, domain(c) domain, protocol, file name, path(d) domain, protocol, path, file name(e) protocol, domain, file name, path

Question 12[2 marks] What is a proxy?
(a) A device that prevents unauthorised access to or from a private network.
(b) A computer which sits between the client and server, intercepts and processes

requests.
(c) A local copy of information for quick access.
(d) A collection of webpages related to a single topic or theme, normally designed andmaintained by a single individual or organisation.
(e) A hypermedia document designed for the WWW.

CONTINUED

VERSION 00000001-5-

COMPSCI 111/111G

Question 13[2 marks] Which of the following is NOT a metaphor or idea that underlies research inArtificial Intelligence?
(a) Abductive inference.
(b) Deductive reasoning.
(c) Hypermedia linking.
(d) Search through a maze.
(e) Memory retrieval.

Question 14[2 marks] Which one of the following statements about Artificial Intelligence is TRUE?
(a) The ability to recognize sentences in a normal conversation sets human

intelligence apart from the intelligence of animals like dogs.
(b) The field of Artificial Intelligence is only a few years away from producing
completely autonomous AI with human-like thought processes and reasoning.
(c) The ‘AI winter’ describes a period of time when, within a few months, several major
discoveries in different areas of AI research were made.
(d) Only embodied agents that exist in a physical environment can exhibit intelligence.
(e) None of the above.
Question 15[2 marks] Which of the following statements about RefWorks is FALSE?
(a) RefWorks lets you insert references into your documents in your choice of citationstyle.
(b) RefWorks is Web based software used for reference management.
(c) RefWorks lets you create a personal database of your references.
(d) RefWorks lets you copy references from numerous library catalogues into yourreference database.
(e) RefWorks is operating system dependent.
Question 16[2 marks] Which one of the following is NOT good advice for the design of PowerPoint
presentations?
(a) The points on a slide should be in note form rather than complete sentences.
(b) The font size of main points should be different than sub-points to emphasize thehierarchy.
(c) Use a simple font rather than a complex font to improve the readability of text.
(d) The colour of text should have high contrast with the background colour.
(e) Important points should be written in capital letters to emphasize the text.

CONTINUED

VERSION 00000001-6-COMPSCI 111/111G

Question 17[2 marks] Which of the following is NOT an important consideration for the content of apresentation?
(a) Carefully consider the topic of the presentation.
(b) Adjust the information contained in the presentation for the expected audience.
(c) Improve the readability of the slides by using Sans Serif fonts.
(d) Logically organize the structure of the content.
(e) Focus on the main points.

Question 18[2 marks] What is a game mechanic?
(a) A game mechanic is a game engine parameter that can be set by a game designer.
(b) A game mechanic is a game developer who specializes in level design.
(c) A game mechanic is a person who develops video games.
(d) A game mechanic is a game element used to manipulate challenges.
(e) A game mechanic is a player who is particularly adept at exploiting bugs in videogames.
Question 19[2 marks] A story created by players during game play is called …
(a) a co-constructed narrative.
(b) an interpreted narrative.
(c) an emergent narrative.
(d) an embedded narrative.
(e) an intended narrative.

Question 20[2 marks] What causes “ludonarrative dissonance”?
(a) Holding two or more contradictory beliefs.
(b) Moral choices in game narratives.
(c) Violent game play.
(d) Immoral game play.
(e) Misalignment between gameplay and story.

Question 21[2 marks] What is Net Neutrality?
(a) Net Neutrality is the principle that all Internet users be treated equally.
(b) Net Neutrality is the principle that all Internet data be treated equally.
(c) Net Neutrality is the principle that all Internet servers be treated equally.
(d) Net Neutrality is the principle that all Internet addresses be treated equally.
(e) Net Neutrality is the principle that all Internet routers be treated equally.

CONTINUED

VERSION 00000001-7-

COMPSCI 111/111G

Question 22[2 marks] If you are experiencing cyberstalking, what should you do?
(a) Meet with the stalker in a public place to discuss his or her infatuation.
(b) Ignore the stalker.
(c) Hire a hit man to “take care of it”.
(d) Try to reason with the stalker.
(e) Clearly and unambiguously tell the stalker to stop contacting you.

Question 23[2 marks] Why was Alan Turing removed from intelligence work?
(a) Because he was accused of espionage by an outed KGB double agent.
(b) Because he was gay.
(c) Because he was diagnosed with paranoid schizophrenia.
(d) Because he visited Germany after World War II.
(e) Because there were no more German cyphers to break.

Question 24[2 marks] Who invented the Internet?
(a) The Xerox Palo Alto Research Centre.
(b) Al Gore.
(c) Tim Berners-Lee.
(d) Many different people and groups.
(e) Vint Cerf and Robert Kahn.

Question 25[2 marks] The best analogy for the modern surveillance state is:(a) The Eye of Sauron (from The Lord of the Rings).
(b) The Sprawl (from Neuromancer).
(c) John Searle’s “Chinese Room” thought experiment.
(d) The Ministry of Truth (from Nineteen Eighty-Four).
(e) The World State (from Brave New World).

CONTINUED

VERSION 00000001-8-

COMPSCI 111/111G

THIS PAGE HAS BEEN INTENTIONALLY LEFT BLANK.

QUESTION/ANSWER SHEET FOLLOWSVERSION 00000001
Question/Answer Sheet-9-

COMPSCI 111/111G
ID ……….…………

SECTION B
Answer all questions in this section in the space provided. If you run out of space, please use
the Overflow Sheet and indicate in the allotted space that you have used the Overflow Sheet.

26. Programming Using Python (10 marks)(a) Write a Python program that prompts the user for a positive integer number. The user
may enter a positive, zero, or negative number. If the number entered by the user ispositive the program should print out the first five entries of that number’s times table,
otherwise it should tell the user that they have entered an invalid value.
The following two examples show the exact formatting expected for the prompts andoutput. Your program must produce the same output as shown below, given the input
shown below.
Example 1:
Enter a positive integer: 8
The 8 Times Table:
8 * 1 = 88 * 2 = 16
8 * 3 = 24
8 * 4 = 32
8 * 5 = 40

Example 2:Enter a positive integer: -2-2 is not a positive integer!

table = int(input("Enter a positive integer: "))if table > 0:
number = 1
print("The", table, "Times Table:")while number <= 5:
result = table * number
print(table, "*", number, "=", result)number = number + 1
else:
print(table, "is not a positive integer!")(4 marks)

CONTINUED

VERSION 00000001
Question/Answer Sheet- 10 -COMPSCI 111/111G
ID ……….…………

(b) Show the output from the following program.
count = 1
end = 6
while count < end:n = count * (count + 1) // 2
print(n)count = count + 1136
1015(3 marks)(c) On the following page, draw the output produced by the turtle in the following Python
program. Assume that the turtle begins in the middle of the window facing right andthat the window is approximately 400 steps wide.
import turtle
steps = 50
angle = 90sides = 8
count = 0
while count < sides:
if count < 4:turtle.forward(steps)
else:
turtle.forward(steps*2)
turtle.left(angle)
count = count + 1

CONTINUED

VERSION 00000001
Question/Answer Sheet- 11 -COMPSCI 111/111G
ID ……….…………

(3 marks)

CONTINUED

VERSION 00000001
Question/Answer Sheet- 12 -COMPSCI 111/111GID ……….…………

27. Spreadsheets (10 marks)
The following spreadsheet displays an invoice for a parallel importer that imports electronic
products and watches to New Zealand.

(a) What is the best formula to use in cell D2? Your formula should fill down from D2 toD8 correctly.

= B2 * C2(1 mark)(b) What is the best formula to use in cell F2? Your answer should use the VLOOKUP
function to retrieve the appropriate Exchange Rate from the Exchange Rate Tablein cells H2:I8. The VLOOKUP function has the following syntax:
VLOOKUP(lookup_value, table_array, col_index_num, range_lookup)

Note: Your formula should fill down from F2 to F8 correctly.

= D2 * VLOOKUP(E2,$H$2:$I$8,2,False)(5 marks)

CONTINUED

VERSION 00000001
Question/Answer Sheet- 13 -COMPSCI 111/111G
ID ……….…………

(c) Cell F9 calculates the total cost of all the items recorded in this invoice. What is thebest formula to use in cell F9?

= SUM(F2:F8)(1 mark)(d) Cell F10 displays whether or not the parallel importer needs to use credit for its
purchase. Credit is required for invoices exceeding $30000 NZD. Cell F10 should
display “Yes” if the invoice total exceeds 30000; otherwise it should display “No”.
What is the best formula to use in cell F10? Your answer must use an IF function.

=IF(F9 > 30000, "Yes", "No")(3 marks)

CONTINUED

VERSION 00000001
Question/Answer Sheet- 14 -COMPSCI 111/111G
ID ……….…………

28. Databases (10 marks)
Use the following Microsoft Access relationship diagram to answer the questions in thissection. Note that the primary key of each table uses the AutoNumber type to ensureuniqueness.

(a) State the name of any foreign key(s) in the Books table.

Author ID
Publisher ID(1 mark)(b) What is the appropriate data type for the Publisher ID field in the Books table?

Number
(1 mark)

CONTINUED

VERSION 00000001
Question/Answer Sheet- 15 -COMPSCI 111/111G
ID ……….…………

(c) Complete the query by example (QBE) form below so that it generates a query that
displays the Book Title, Date Published, and Type of every book written byStephen King. The results should be sorted in descending order based on the DatePublished. Some example results from the query might be:(4 marks)(d) Write an SQL query that displays the Book Title and Date Published of all books
whose type is “Paperback”. The results should be sorted in ascending order basedon the Book Title. Some example results from the query might be:

Select [Book Title], [Date Published]
From Books
Where Type = “Paperback”
Order by [Book Title];(4 marks)

CONTINUED

VERSION 00000001
Question/Answer Sheet- 16 -COMPSCI 111/111G
ID ……….…………

29. LaTeX (10 marks)
On the following page, complete the LaTeX code that will produce the output below:

The following LaTeX commands have been included as a reference. You will not need touse all of these commands. Note that the basic document structure has been completed foryou.
Normal commands

Environments

Math mode commands\emph{}\section{}\subsection{}\subsubsection{}\large\textbf{}\title{}\author{}\date{}\maketitle\item\ldotsitemizeenumerate
verbatimflushrightcenterquote
displaymathequation
quotation$\sqrt{}\geq\frac{}{}\left(\right)\pi\sum_{}^{}^_CONTINUEDVERSION 00000001
Question/Answer Sheet- 17 -COMPSCI 111/111G
ID ……….…………

\documentclass[a4paper]{article}\begin{document}\title{Chemistry}\author{A. Lecturer}\date{Summer School 2015}\maketitle\section{Chemical Reactions}
The most general description of a \emph{chemical reaction
network} includes the term
\begin{equation}\sum_{i=1}^{N}s_{ij}X_i\end{equation}
where\begin{itemize}\item $j$ is the reaction index running from 1 to $R$,
\item $X_i$ denotes the \textbf{i}-th chemical species and\item $\pi$ is irrelevant\ldots\end{itemize}\end{document}(10 marks)

CONTINUED

VERSION 00000001
Question/Answer Sheet- 18 -COMPSCI 111/111G
ID ……….…………

30. HTML5 and CSS (10 marks)
The following screenshot shows the body of a web page created using HTML5 and CSS:

Complete the HTML5 code below so that it produces the output shown above.
You must use the styles defined in the internal style sheet in the head section below, andmust not define any new styles.
Note: The url for the FIFA Club World Cup webpage is:"http://www.fifa.com/clubworldcup".
<!DOCTYPE html><html><head><meta charset="UTF-8"><title>HTML5 Exam Question</title><style type="text/css">
h1, h2{
background-color: #C0C0C0;
text-align: center;font-family:sans-serif;}table, tr, td{border: 1px solid black;}#tableheader{

CONTINUED

VERSION 00000001
Question/Answer Sheet- 19 -COMPSCI 111/111G
ID ……….…………

font-size: large;
font-weight: bold;text-align: center;}.position{text-align: center;}</style></head><body><!-- Main Heading --><h1>FIFA Club World Cup</h1>(1 mark)<!-- "About" section --><section><h2>About</h2><p>
The <a href="http://www.fifa.com/clubworldcup">FIFA ClubWorld Cup</a> is an annual international football competition
started in 2000.
</p></section>(3 marks)<!-- "Some Past Winners" section --><section><h2>Some Past Winners</h2><ul><li>Barcelona (2 titles)</li><li>Corinthians (2 titles)</li></ul></section>(2 marks)

CONTINUED

VERSION 00000001
Question/Answer Sheet- 20 -COMPSCI 111/111G
ID ……….…………

<!-- "2014 Tournament" section --><section><h2>2014 Tournament</h2><table><tr id = "tableheader"><td>Position</td><td>Team</td>
</tr>
<tr>
<td class = "position">1</td><td>Real Madrid</td>
</tr>
<tr>
<td class = "position">2</td><td>San Lorenzo</td>
</tr>
<tr>
<td class = "position">3</td><td>Auckland City</td></tr></table></section>(4 marks)</body></html>CONTINUED

VERSION 00000001
Question/Answer Sheet- 21 -COMPSCI 111/111G
ID ……….…………

- Overflow Sheet 1 Write the question number and letter next to your answer. You must ALSO indicate in
the allotted space that you have used the overflow sheet.

CONTINUED

VERSION 00000001
Question/Answer Sheet- 22 -COMPSCI 111/111G
ID ……….…………

- Overflow Sheet 2 Write the question number and letter next to your answer. You must ALSO indicate in
the allotted space that you have used the overflow sheet.

CONTINUED

VERSION 00000001
Question/Answer Sheet- 23 -COMPSCI 111/111G
ID ……….…………

Rough Working – This page will not be marked

CONTINUED

VERSION 00000001
Question/Answer Sheet- 24 -COMPSCI 111/111G
ID ……….…………

Rough Working – This page will not be marked________________________________________