THE UNIVERSITY OF AUCKLAND

SECOND SEMESTER, 2020

Campus: NZ Online, Offshore Online

COMPUTER SCIENCE

An Introduction to Practical Computing


NOTE:

• You must answer all questions in this exam.

• You will need to put your answers into the Answer Booklet and save the file as a pdf format. Upload the file to Canvas, the way you do for your lab assignments.

• You need to demonstrate your understanding of the subject matter and the ability to construct a well described solution or organised argument to answer the question(s).



Student support instructions:

The Contact Centre will be open 8am–9.45pm Monday to Friday and 8am–5.45pm Saturday, throughout the Exam period.

If you wish to raise concerns during the Online Exam, please call Auckland: 09 373 7513, New Zealand: 0800 61 62 63, or International: +64 9 373 7513.

If you have an issue with Canvas, live chat is available 24/7 with Canvas Support, via the Help button within your Canvas left-hand side bar. If you are in New Zealand, you can also call the Canvas Support Hotline on 0800 005 205.

It is your responsibility to ensure your assessment is successfully submitted on time. Please don’t leave it to the last minute to submit your assessment.

If any corrections to the Online Exam are made you will be notified by a Canvas Announcement. Please ensure your notifications are turned on during this period.


Academic honesty declaration

By completing this assessment, I agree to the following declaration:

I understand the University expects all students to complete coursework with integrity and honesty. I promise to complete all online assessments with the same academic integrity standards and values. Any identified form of poor academic practice or academic misconduct will be followed up and may result in disciplinary action.

As a member of the University’s student body, I will complete this assessment in a fair, honest, responsible and trustworthy manner. This means that:

• I declare that this assessment is my own work, except where acknowledged appropriately (e.g. use of referencing).

• I will not seek out any unauthorised help in completing this assessment. (NB. Unauthorised help includes a tutorial or answer service whether in person or online, friends or family, etc.)

• I am aware the University of Auckland may use Turnitin or any other plagiarism detecting methods to check my content.

• I will not discuss the content of the assessment with anyone else in any form, including, Canvas, Piazza, Chegg, Facebook, Twitter or any other social media within the assessment period.

• I will not reproduce the content of this assessment in any domain or in any form where it may be accessed by a third party.


Submission Instructions

When you have finished answering all the exam questions, save the file as a pdf document then upload it to Canvas. Name your file with your username (e.g. abcd999.pdf). Please ensure you submit your pdf file to Canvas BEFORE the due time. Do not leave it to the last minute as otherwise your exam submission will be flagged as late.


SECTION A – SHORT ANSWERS

Answer all questions in the space provided in the separate answer booklet.


Question 1. Artificial Intelligence (3 marks)

What argument is Searle making in his Chinese Room discussion about the nature of intelligence and how it applies to Artificial Intelligence programs?

Answer in the Answer Booklet.

The answer should be 100 words or less.

(3 marks)

Question 2. Software Licences (3 marks)

What is the main difference between software that is freeware and open source software?

Answer in the Answer Booklet.

The answer should be 100 words or less.

(3 marks)

Question 3. Digital Games (3 marks)

Give an example of a stochastic board game and of a non-stochastic board game, and discuss how they exemplify their type of board game.

Answer in the Answer Booklet.

The answer should be 100 words or less.

(3 marks)

Question 4. Computer Hardware (3 marks)

Which component within a computer (desktop or laptop) are almost all of the computer’s other components connected to? Describe this component’s purpose.

Answer in the Answer Booklet.

The answer should be 100 words or less.

(3 marks)

Question 5. History of Computing (3 marks)

Describe the roles of the four people involved in preparing scientific tables before the advent of computers.

Answer in the Answer Booklet.

The answer should be 100 words or less.

(3 marks)

Question 6. Computer Networks (3 marks)

Describe the difference between circuit switching and packet switching on a network.

Answer in the Answer Booklet.

The answer should be 100 words or less.

(3 marks)

Question 7. WWW (3 marks)

On the WWW, what is the difference between the HTTP and HTTPS protocols?

Answer in the Answer Booklet.

The answer should be 100 words or less.

(3 marks)

Question 8. Malware (3 marks)

What is the difference between a computer virus and a computer worm?

Answer in the Answer Booklet.

The answer should be 100 words or less.

(3 marks)

Question 9. Bits and Bytes (3 marks)

How much memory would be required to represent 248 different values?

Answer in the Answer Booklet.

(3 marks)

Question 10. Digital Images (3 marks)

How much memory would be required to store a 32-colour bitmap image that is 100 pixels wide and is 16 pixels high? Show all your working.

Answer in the Answer Booklet.

(3 marks)


SECTION B

Answer all questions in the space provided in the separate answer booklet.


Question 11. Programming Using Python (15 marks)

(a) The following exponential function can be used to predict the spread of flu-like diseases:

where d is the day number. The value for Day 0 is defined to be 1.

Write a Python program that calculates and displays the number of flu infections after a certain number of days. The number of days to predict is entered by the user. You can assume that the user will always enter an integer value greater than or equal to 1. Here are two examples of the program running with different values entered by the user. User input is indicated in the examples with bold and italicized font.

Example 1:

Enter the number of days to predict: 5

The number of cases at day 1 is 1

The number of cases at day 2 is 2

The number of cases at day 3 is 4

The number of cases at day 4 is 8

The number of cases at day 5 is 16

Example 2:

Enter the number of days to predict: 1

The number of cases at day 1 is 1

Answer in the Answer Booklet.

(5 marks)

(b) Write a piece of code that prints the visibility rating for the visibility distance entered by the user at the prompt "Enter the Visibility Distance: ". Use the table below to determine the visibility rating. You can assume that the user will always enter a floating-point number (i.e. a float). Two examples are given below.



Example 1:

Enter the Visibility Distance: 0.2

Your Visibility Rating is Fog

Example 2:

Enter the Visibility Distance: 6.0

Your Visibility Rating is Fair

Answer in the Answer Booklet

(5 marks)

(c) In the answer booklet, complete the code that will make the following picture. Assume that the turtle begins in the middle of the window facing right and that the window is approximately 500 steps wide. NOTE: You must use a while loop.

import turtle

steps = 100

angle1 = 45

angle2 = 90

number_of_repetitions = 10

step_increment = 10

Complete in the Answer Booklet.

(5 marks)


Question 12. Spreadsheets (15 marks)

The following spreadsheet displays information about the lunch a person had each day for one week.


(a) Columns C to G of Rows 4 to 10 contain information about the lunch that the person had on the day specified in Column B. What is the best formula to use in Cell E4 to find the total number of calories the person consumed for lunch on the day specified in Cell B4? The calorie table is located in Cells C17 : D23. Your answer must use a VLOOKUP function.

Note: Your formula must be able to be filled down from E4 to E10 correctly.

=VLOOKUP(______,_________________,_____,_____)* ____

Answer in the Answer Booklet.

(6 marks)

(b) Cell G4 indicates the number of calories consumed for lunch on the day specified in Cell B4 that are under or over the goal number of calories specified in Cell E14What is the best formula to use in Cell G4?

Note: Your formula must be able to be filled down from G4 to G10 correctly.

Answer in the Answer Booklet.

(2 marks)

(c) Cell E11 shows the total number of calories consumed for lunch for the week. What is the best formula to use in Cell E11?

Answer in the Answer Booklet.

(2 marks)

(d) Cell E13 shows the average (mean) number of calories consumed for lunch each day. What is the best formula to use in Cell E13?

Answer in the Answer Booklet.

(2 marks)

(e) Cell G13 indicates whether the average number of calories in Cell E13 is under or over the goal number of calories specified in Cell E14. If the average is less than the goal value, G13 should show “Under”. If the average is higher than the goal, then Cell G13 should show “Over”. If the average is equal to the goal then Cell G13 is left blank. What is the best formula to use in Cell G13?

Note: Your formula must use an IF function.

Answer in the Answer Booklet.

(3 marks)


Question 13. HTML5 and CSS (20 marks)

The following screenshot shows the body of a web page created using HTML5 and CSS:


Complete the HTML5 code in the answer booklet so that it produces the output shown above.

You must use the styles defined in the internal style sheet in the head section on the following page, and must not define any new styles.

Note:

(1) The URL for the University of Auckland Online Learning Resources is: “https://www.online.auckland.ac.nz/”.

(2) The image is stored in a file called "AucklandOnlineImage.png" in the same folder as the HTML file.

(3) There are two sections (the “Student Statistics” section and the “Slang Glossary” section).


<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>HTML/CSS Exam Question</title>

<style>

body {background-color: pink;

font-family: "Arial", "Calibri", Sans-Serif}

h1 {background-color:rgb(0,0,0); color:#E6FFE6;

text-transform:uppercase; text-align:center}

h2 {background-color:rgb(0,0,0); color:#E6FFE6;

font-variant:small-caps}

table, tr, td { border: 2px solid black;}

#emphasis{font-size:large; color:red}

#center {text-align:center}

#tablehead {background-color:rgb(0,0,0); color:#E6FFE6;

font-weight:bold; text-align:center}

.glossary{font-style:italic; font-weight:bold}

.stat{text-align:right; font-weight:bold}

</style>

</head>

<body>


<!-- Main Heading -->

Answer in the Answer Booklet.

(1 mark)

<!-- image -->

Answer in the Answer Booklet.

(2 marks)

<!-- First Paragraph -->

Answer in the Answer Booklet.

(2 marks)

<!-- "Student Statistics" Section -->

Answer in the Answer Booklet.

(7 marks)

<!-- "Slang Glossary" Section -->

Answer in the Answer Booklet.

(8 marks)

</body>

</html>


Question 14. LaTeX (20 marks)

On the following pages, complete the LaTeX code that will produce the output below:


The image is stored in a file called Covid.png and is in the same folder as the LaTeX code. When inserted into the document, the image should be centred and 6 cm wide.

The following LaTeX commands have been included as a reference. You will not need to use all of these commands. 



\documentclass[a4paper]{article}

\begin{document}

Answer in the Answer Booklet.

\end{document}

(20 marks)