0% found this document useful (0 votes)
148 views22 pages

The University of Auckland: Second Semester, 2014 Campus: City

This document appears to be an exam for a Computer Science course consisting of multiple choice and short answer questions. It is divided into two sections - Section A contains 25 multiple choice questions worth a total of 50 marks. Section B contains 5 short answer questions, each worth 10 marks, on topics including programming using Python, spreadsheets, databases, LaTeX, and XHTML/CSS for a total of 100 marks. The exam instructions state that all questions must be answered, no calculators are permitted, and there is space in the back of the booklet for answers that overflow the allotted space.

Uploaded by

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

The University of Auckland: Second Semester, 2014 Campus: City

This document appears to be an exam for a Computer Science course consisting of multiple choice and short answer questions. It is divided into two sections - Section A contains 25 multiple choice questions worth a total of 50 marks. Section B contains 5 short answer questions, each worth 10 marks, on topics including programming using Python, spreadsheets, databases, LaTeX, and XHTML/CSS for a total of 100 marks. The exam instructions state that all questions must be answered, no calculators are permitted, and there is space in the back of the booklet for answers that overflow the allotted space.

Uploaded by

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

VERSION 00000001 COMPSCI 111/111G

THE UNIVERSITY OF AUCKLAND

SECOND SEMESTER, 2014


Campus: City

COMPUTER SCIENCE

An 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.

Surname
0B

Forenames
1B

Student ID
2B

Sample Solutions
3B

Login (UPI)
4B

Question Mark Out Of

1 - 25 Multiple Choice 50

26 Programming using Python 10

27 Spreadsheets 10

28 Databases 10

29 LaTeX 10

30 XHTML and CSS 10

TOTAL 100

CONTINUED
VERSION 00000001 -2- COMPSCI 111/111G

SECTION A

MULTIPLE CHOICE QUESTIONS


Each question in this section is worth 2 marks. There is only one correct answer for each
question. 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 shading
in the appropriate box.

Question 1
[2 marks] Which binary number equals the decimal number 99?

(a) 1111111
(b) 111
(c) 1100011
(d) 1010011
(e) None of the above

Question 2
[2 marks] Which of the following lists is in increasing order of magnitude?

(a) 1 MiB, 1 MB, 1TiB, 1TB.


(b) 1 KB, 1 KiB, 1 MB, 1 TiB.
(c) 1 GB, 1000 MB, 1000 MiB, 1 KB.
(d) 1 KiB, 1 KB, 1 MB, 1 TiB.
(e) 1 GiB, 1000 MiB, 1 TB, 1 TiB.

Question 3
[2 marks] Which one of the following statements is FALSE?

(a) Hard drives hold more information than RAM, and can access the information
faster than RAM.
(b) Blu-ray discs have a larger storage capacity than DVDs.
(c) Multiple hard drives can be connected together in a RAID to improve the speed of
information transfer.
(d) RAM is more expensive per MB than hard disk capacity.
(e) The information in a hard drive remains when the power is switched off.

CONTINUED
VERSION 00000001 -3- COMPSCI 111/111G

Question 4
[2 marks] Which one of the following statements is FALSE?

(a) Freeware is not the same as open-source software.


(b) Programs are loaded from secondary storage into primary memory before they are
executed.
(c) If an application is created and sold as a proprietary product, then you cannot legally
copy that software.
(d) Proprietary software can sometimes be available without having to pay for it.
(e) Microsoft Word uses a graphical user interface, but Microsoft Excel uses a
command line interface.

Question 5
[2 marks] Which one of the following is classified as system software?

(a) Software that allows a user to send an email.


(b) Software that allows a user to write a letter.
(c) Software that allows a user to create a poster.
(d) Software that allows a user to remove a virus.
(e) Software that allows a user to browse the web.

Question 6
[2 marks] Which of the following is the main purpose of file extensions?

(a) To allow the OS to see which files can be compressed.


(b) To allow the OS to determine the file format.
(c) To allow the OS to order files in a hierarchical folder structure.
(d) To allow the user to see what the file is good for.
(e) All of the above

CONTINUED
VERSION 00000001 -4- COMPSCI 111/111G

Question 7
[2 marks] What is the main purpose of protocols used on the Internet?

(a) To increase the reliability of packet-switching networks.


(b) To speed up the transfer of data between two systems.
(c) To prevent errors from occurring in the data transmission process.
(d) To ensure that two systems can communicate through a network, even when part of
that network fails.
(e) To provide a standard way to communicate between two computers.

Question 8
[2 marks] Which of the following is NOT needed for home broadband access including
Wifi?

(a) Network card (possibly integrated in computer).


(b) Satellite dish.
(c) Contract with a telecommunications company.
(d) Wifi capable broadband modem/router.
(e) Telephone line.

Question 9
[2 marks] Which of the following best describes the transfer of an email when both sender
and recipient use a mail client?

(a) Message sent to mail server via SMTP, mail server contacts DNS server, message
sent over the Internet using TCP, recipient collects mail from recipient mail
server using IMAP or POP3.
(b) Message sent to mail server via SMTP, mail server contacts spam checker, spam
checker accepts message, mail server sends message to recipient's local computer.
(c) Message sent to mail server via IMAP, mail server contacts DNS server, message sent
over the Internet using TCP, message copied from recipient mail server to recipient's
local computer using SMTP.
(d) Message sent to mail server via SMTP, mail server contacts DNS server, DNS server
contacts recipient mail server, recipient's local computer downloads message using
POP3.
(e) Email sent via secure HTTP to ISP's web server, web server sends message using
TCP to recipient ISP web server, recipient reads message using IMAP.

CONTINUED
VERSION 00000001 -5- COMPSCI 111/111G

Question 10
[2 marks] Which of the following statements is FALSE?

(a) The conversation view of messages on Gmail is useful to keep track of answers to a
message.
(b) Netiquette is a set of rules that define polite online behaviour.
(c) In most countries companies cannot legally read their employees’ email.
(d) The Bcc field can be used to allow a person other than the main recipient to see the
message.
(e) SMTP is used to send messages, IMAP is used to receive messages.

Question 11
[2 marks] Which of the following modes of communication is synchronous?

(a) Text messaging.


(b) Telephone conversation.
(c) Paper letters.
(d) Telefax.
(e) Email.

Question 12
[2 marks] Who developed the first wiki?

(a) Tim Berners-Lee.


(b) Bill Gates.
(c) Ward Cunningham.
(d) Ray Tomlinson.
(e) Marc Andreessen.

CONTINUED
VERSION 00000001 -6- COMPSCI 111/111G

Question 13
[2 marks] Which of the following statements about the PageRank algorithm is FALSE?

(a) PageRank was not used by the Alta Vista search engine.
(b) Pages with a high PageRank value are put higher up in the results of a Google search.
(c) PageRank associates a number with a page that represents the likelihood that a person
randomly clicking on links will arrive at that page.
(d) PageRank was developed in 1996 at Stanford by the people who later founded
Google.
(e) PageRank provides a number measuring the quality of a web page.

Question 14
[2 marks] Which of the following statements is TRUE?

(a) RefWorks allows users to create an account and develop their own database of
references.
(b) LaTeX is easier to use than MS Word for producing text documents.
(c) MS Word does not allow hyperlinks to be added to the text.
(d) MS Word 2003 used ribbons.
(e) MS Word was developed by Donald Knuth.

Question 15
[2 marks] Which of the following was NOT developed at Xerox PARC?

(a) Smalltalk, an early object-oriented programming language.


(b) Computer Mouse.
(c) WYSIWYG text editor.
(d) GUI.
(e) Laser Printer.

Question 16
[2 marks] Which of the following computers was the first commercially available personal
computer?

(a) Altair 8800.


(b) Apple I.
(c) IBM PC.
(d) Commodore 64.
(e) Compaq 386.

CONTINUED
VERSION 00000001 -7- COMPSCI 111/111G

Question 17
[2 marks] What historical event led to the production of the electronic digital computers
Colossus and ENIAC?

(a) The Space Race.


(b) The Great Depression.
(c) The American Civil War.
(d) World War II.
(e) The Cold War.

Question 18
[2 marks] Which of the following statements concerning presentation design is TRUE?

(a) Writing text in the form of paragraphs rather than bullet point lists is recommended.
(b) Using the same background consistently throughout a presentation is
recommended.
(c) A ‘Conclusion’ slide is usually unnecessary and should not be used.
(d) Each slide should contain material for at least 10 minutes of talking.
(e) Reading points verbatim to the audience makes it easy for them to follow and is the
recommended way of presenting.

Question 19
[2 marks] Which of the following statements concerning PowerPoint is FALSE?

(a) PowerPoint is the most widely used presentation software.


(b) In order to make sure a PowerPoint presentation runs on any system, embedding fonts
in the presentation is recommended.
(c) PowerPoint templates can make a presentation look more consistent and professional.
(d) PowerPoint is part of the open-source office suite LibreOffice.
(e) PowerPoint has been criticized for forcing people to fit ideas into PowerPoint’s
limited format.

CONTINUED
VERSION 00000001 -8- COMPSCI 111/111G

Question 20
[2 marks] How many bytes are required to store an image that is 100 pixels wide, 40 pixels
high, and uses 16 colours?

(a) 16,000 bytes.


(b) 1500 bytes.
(c) 2000 bytes.
(d) 12,000 bytes.
(e) None of the above.

Question 21
[2 marks] Which one of the following statements about image compression algorithms is
FALSE?

(a) GIF is better for graphics than it is for photos.


(b) PNG uses a patented compression algorithm.
(c) JPEG is a lossy compression algorithm.
(d) JPEG lets you choose the degree of compression used.
(e) PNG supports 16 million colours.

Question 22
[2 marks] Which of the following is NOT a form of complex reasoning studied by artificial
intelligence?

(a) Abduction.
(b) Analogy.
(c) Subduction.
(d) Deduction.
(e) None of the above.

Question 23
[2 marks] Which of the following is NOT a characteristic of rule-based methods used in
artificial intelligence?

(a) Specify programs in terms of if-then statements.


(b) Support coding of highly flexible behaviours.
(c) Emphasize the conditional nature of behaviour.
(d) Often use list structures and pattern matching.
(e) Enable efficient numerical calculation.

CONTINUED
VERSION 00000001 -9- COMPSCI 111/111G

Question 24
[2 marks] Which of the following is NOT a key idea in thinking about intelligence in terms
of searching through a problem space?

(a) Routine behaviours stored in memory.


(b) A goal state or description.
(c) An initial problem state.
(d) Operators that change states.
(e) A solution path through the space.

Question 25
[2 marks] Which of the following is NOT a likely development in the future of computing?

(a) Widespread embedded computing.


(b) Personal robots.
(c) Wearable interfaces.
(d) Vacuum-powered transistors.
(e) Virtual environments.

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

THIS PAGE HAS BEEN INTENTIONALLY LEFT BLANK.


VERSION 00000001 - 11 - COMPSCI 111/111G

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 to enter an integer greater than one.
If the user enters a number that is not greater than one, the program should print out
the message “You did not enter an integer greater than one”.
Otherwise the program should calculate and print out the value that is the sum of the
cubes of all numbers from 1 up to (and including) the number entered by the user.
The following two examples show the exact formatting expected for prompts and
output. Given the input shown below, your program must produce the same output.
Example 1:
Enter an integer greater than one: -2
You did not enter an integer greater than one
Example 2:
Enter an integer greater than one: 2
The answer is 9

number = int(input("Enter an integer greater than one: "))

if number <= 1:
print("You did not enter an integer greater than one")
else:
total = 0
n = 1
while n <= number:
total = total + n ** 3
n = n + 1
print("The answer is", total)

(4 marks)
VERSION 00000001 - 12 - COMPSCI 111/111G

(b) Show the output from the following Python program.


x = 4
y = 5
z = 21
while z >= x + y:
print(z)
if z % 5 == 0:
z = z - y
else:
z = z - x

21
17
13
9

(3 marks)

(c) On the following page, draw the output produced by the turtle in the Python program
given below. Assume that the turtle begins in the middle of the window, facing right,
and that the window is approximately 800 steps wide.

import turtle

turtle.backward(50)

n = 6
angle = 360/(n - 1)
count = 0
while count < (n - 1):
turtle.forward(100)
turtle.left(angle)
count = count + 1
VERSION 00000001 - 13 - COMPSCI 111/111G

(3 marks)
VERSION 00000001 - 14 - COMPSCI 111/111G

27. Spreadsheets (10 marks)

The following spreadsheet calculates the classification for 6 earthquakes whose magnitude
has been measured using the Richter scale. The “Building Damage” column contains the
word “Yes” if the magnitude of the earthquake is 5 or more on the Richter scale, and “No”
otherwise.

(a) Cell D8 calculates the mean magnitude of all the earthquakes recorded in this
spreadsheet. What is the best formula to use in cell D8?

=AVERAGE(D2:D7)

(2 marks)

(b) What is the best formula to use in cell E2? Your answer must use an IF function and
must be able to be filled down from E2 to E7 correctly.

=IF( D2 >= 5 , "Yes" , "No" )

(3 marks)
VERSION 00000001 - 15 - COMPSCI 111/111G

(c) What is the best formula to use in cell F2? Your answer should use the vlookup
function to retrieve the appropriate Classification from the Magnitude/Classification
Table in cells H2:I8. The vlookup function has the following syntax:
vlookup(lookup_value, table_array, col_index_num,[range_lookup])

Note: Your formula should be able to be filled down from F2 to F7 correctly.

=VLOOKUP( D2, $H$2:$I$8, 2, TRUE )

(5 marks)
VERSION 00000001 - 16 - COMPSCI 111/111G

28. Databases (10 marks)

Use the following Microsoft Access relationship diagram to answer the questions in this
section. Note that the primary key of each table uses the AutoNumber type to ensure
uniqueness.

(a) State the name of any foreign keys in the Albums table, along with their related
table(s).

ArtistID (Related Table Artist)

LabelID (Related Table Label)


(1 mark)

(b) What is the appropriate data type for the ReleaseYear field in the Albums table?

Number

(1 mark)
VERSION 00000001 - 17 - COMPSCI 111/111G

(c) Complete the Query By Example (QBE) form below so that it generates a query that
displays the Album Name of every album that was released after the year 1980, as
well as the First Name and Surname of the artist, and the Label Name of the record
company. Some example results might be:

(4 marks)

(d) Write an SQL query that displays the First Name and Surname of every Artist with
an Age older than 25. The results should be sorted in ascending order based on the
artist’s Surname. Some example results from the query might be:

SELECT FirstName, Surname

FROM Artist

WHERE Age > 25

ORDER BY Surname;
(4 marks)
VERSION 00000001 - 18 - COMPSCI 111/111G

29. LaTeX (10 marks)

Write the LaTeX code that will produce the following output:

The following LaTeX commands have been included as a reference. You will not need to
use all of these commands. Note that the basic document structure has been completed for
you.
Normal commands Environments Math mode commands

\emph{} itemize $
\section{} enumerate \sqrt{}
\subsection{} verbatim \geq
\subsubsection{} flushright \frac{}{}
\ldots center \left(
\textbf{} quote \right)
\title{} displaymath \pi
\author{} equation \sum_{}^{}
\date{} quotation \ldots
\maketitle
\item ^
_
VERSION 00000001 - 19 - COMPSCI 111/111G

\documentclass[a4paper]{article}
\begin{document}

\title{Pi}
\author{W. Iki}
\date{Semester 2 2014}
\maketitle
\section{Introduction}

$\pi$ is a \emph{mathematical constant}


approximately equal to 3.14159. It is
spelled out as ``pi''.

\subsection{Infinite Series}

The first \textbf{infinite sequence}


discovered in Europe in 1593 was :

\begin{displaymath}
\frac{2}{\pi} = \frac{\sqrt{2}}{2} *
\frac{\sqrt{2+\sqrt{2}}}{2}\ldots
\end{displaymath}

\end{document}
(10 marks)
VERSION 00000001 - 20 - COMPSCI 111/111G

30. XHTML and CSS (10 marks)


The following screenshot shows the body of a web page created using XHTML 1.0 strict and
cascading style sheets:

Complete the XHTML 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, and
must not define any new styles.

Note: 1) The url for the Wikipedia webpage for horror films is:
http://en.wikipedia.org/wiki/Horror_film
2) The table has a 1 pixel border.

<?xml version="1.0" encoding="utf-8"?>


<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title>Horror Films</title>

<style type="text/css">

h1, h2 {
background-color: gray;
color: white;
text-align: center;
font-family: cursive;
}
VERSION 00000001 - 21 - COMPSCI 111/111G

.directors { font-weight: bold; }

.films { font-style: italic; }

#tableheader {
font-size: large;
font-weight: bold;
text-align: center;
}
</style>
</head>

<body>

<!-- Horror Films -->

<h1>Horror Films</h1>

<p>
Horror films entertain viewers by playing on their
primal fears. For more information on horror films
click
<a href =
"http://en.wikipedia.org/wiki/Horror_film">here</a>.
</p>

(3 marks)
<!-- Favourite Directors -->

<h2>Favourite Directors</h2>

<dl>
<dt class="directors">Ti West</dt>
<dd class="films">The Innkeepers</dd>
<dt class="directors">Adam Wingard</dt>
<dd class="films">You're Next</dd>
</dl>

(4 marks)
VERSION 00000001 - 22 - COMPSCI 111/111G

<!-- Movie Night-->

<h2>Movie Night</h2>

<table border="1px">
<tr id="tableheader">
<td>Movie</td>
<td>Time</td>
</tr>
<tr>
<td class="films">A Nightmare On Elm Street</td>
<td>22:00 - 0:00</td>
</tr>
</table>

(3 marks)
</body>
</html>

You might also like