Don't Panic!: CSC 105 A01 Midterm 2

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

CSC105 A01 Instructor: Rich Little

CSC 105 A01 Midterm 2


Wednesday, November 25, 2015
50 minutes

Name:_____________________________

Student Number:_______________________

 Write your name and student number in the spaces provided above.
 This is a closed book exam. No notes or written material of any kind are allowed. No
calculators allowed.
 This exam has 15 pages, including this information page. You may write anywhere on
this booklet.
 This exam consists of 35 multiple choice questions worth 1 mark each. Please mark
your answers on the Mark Sense form. You may use a pen or pencil.

AT THE END OF THE EXAM TURN IN THE MARK SENSE FORM ONLY

And remember the golden rule about writing an exam:

Don’t Panic!

Page 1
CSC105 A01 Instructor: Rich Little
1. Disk drives that use laser beams instead of magnets to read and write are called _________
A) Hard drives
B) CD/DVD-RW drives
C) CD/DVD-ROM drives
D) solid state drives
E) flash drives

2. A correct webpage has a ___________ section which contains a ________ section first, followed by a
___________ section.
A) HTML, BODY, HEAD
B) HTML, HEAD, BODY
C) BODY, HTML, HEAD
D) BODY, HEAD, HTML
E) HEAD, HTML, BODY

3. What is an advantage of a hard disk over a USB stick?


A) No moving parts
B) Can hold more data for the same price
C) Non-volatile
D) Both A and B
E) Both B and C

4. Which of the following services is NOT provided by an Operating System?


A) Coordination of network communications.
B) Management of memory.
C) Coordination of concurrent processing.
D) Communication with peripherals.
E) Compilation of source code.

5. The look and feel of software, from a human point of view, is called the ___________.
A) translator
B) user interface
C) compiler
D) application program
E) none of the above

6. An advantage of bitmap graphics over vector graphics is:


A) better for creating printed graphs
B) lines are clearer
C) shapes are smoother
D) better for touching up photographs
E) takes up less memory

Page 2
CSC105 A01 Instructor: Rich Little
7. Which of the following statements is FALSE about JPG compression?
A) It was invented by the Joint Photographic Experts Group.
B) It is Lossy.
C) It is Lossless.
D) It works very well with photos.
E) None of the above

8. Which of the following compression techniques is lossy?


A) mp3
B) GIF
C) Huffman tree
D) jpeg
E) Both A and D

9. A compiler translates a program written in a high-level language into


A) machine language.
B) an algorithm.
C) Java.
D) C#.
E) natural language.

10.Which of the following is the most famous example of open-source software?


A) Microsoft Windows
B) Mac OS X
C) UNIX
D) Linux
E) Google

11. Software that stores individual pixels rather than lines and shapes is known as:
A) vector graphics software.
B) bitmap graphics software.
C) photo database software.
D) resolution software.
E) CAM software.

12. Order the following storage devices by speed, from slowest to fastest – hard disk (or hard drive), RAM,
CD-ROM.
A) CD-ROM, RAM, Hard disk
B) Hard disk, CD-ROM, RAM
C) RAM, hard disk, CD-ROM
D) RAM, CD-ROM, hard disk
E) CD-ROM, hard disk, RAM

13.In JavaScript, which of the following relational operators represents “assignment”?


A) !=
B) =
C) = =
D) <>
E) =!
Page 3
CSC105 A01 Instructor: Rich Little
14.You are presented with the following Huffman encoding information. Which binary tree correctly represents
this encoding? Note, left = 0 and right = 1.
Text to encode: CSC100 + CSC110
Huffman encoding:
01000010011010110111110010000100100110

A)

B)

C)

D)

Page 4
CSC105 A01 Instructor: Rich Little
15.You're a technical advisor for a company and your boss comes to you one day to inquire about purchasing
new hardware for the office. The office needs to be able to store various documents that are created on a
day-to-day business for future reference. You are asked which upgrade would be most appropriate:
A) Buying more RAM for the office computers
B) Buying a larger hard drive for the office computers
C) Buying new CPU's for the office computers
D) Buying new monitors for the office computers
E) Buying a Toronto Maple Leafs flag and hanging it over the office computers.

16.What is the purpose of a database query?


A) To update information kept within a record
B) To test the security and integrity of the database
C) To rearrange the order of the records in a database
D) To convert a relational database into an object-oriented database
E) To retrieve information from all appropriate records

17.Which of the following is NOT a way of compressing an audio file?


A) increase sample (bit) rate
B) decrease bit depth
C) remove imperceptible sounds
D) remove quiet sounds competing with loud
E) none of the above

18.What does the following style sheet entry state/define?

.PARA { font-color: red }

A) That all text in the HTML document will be red.


B) That all text enclosed in a paragraph tag in the HTML document will be red.
C) That all text enclosed in a paragraph tag which has the "para" class, will be red.
D) All of the above
E) None of the above

19. To place an image on the right side of the window with the text filling the area to the left of the image, the
tag would need to look like
A) <img src = “mountains.jpg” style = “float: right”>
B) <img src align = “mountains.jpg” “right”>
C) <img “mountains.jpg” src align = “right”>
D) <img = “mountains.jpg” align src = “float: right”>
E) All of the above will work

20.Which of the following HTML tags does not have a closing tag?
A) <P>
B) <UL>
C) <BR>
D) <I>
E) <B>

Page 5
CSC105 A01 Instructor: Rich Little
21.Once a web page is created, it must be uploaded to ________ to be seen on the WWW.
A) a File Server
B) an E-mail Server
C) a Web Server
D) a Printer Server
E) Connex

Consider the following ER diagram for Question 22 and 23.

Table Authors Table Books


Au_ID PK # B_ID PK #
First_Name T Title T
Last_Name T Category T
Au_Rank # B_Rank #

Au_Comments T B_Comment T

Au_ID FK #

Au_Rank and B_Rank are numbers from 1 to 10, 10 being higher (better) in rank than 1.

22. What is the list of combinations from the Books and Authors tables where
both the writer and the book are rated 9? The query should return only the author’s name and the book title.

A) SELECT Authors.Last_Name, Authors.First_Name, Authors.Title


FROM Books, Authors
WHERE Authors.B_Rank = 9 AND Authors.Au_Rank = 9 AND Authors.Au_ID = Books.Au_ID

B) SELECT Authors.Last_Name, Authors.First_Name, Books.Title


FROM Books, Authors
WHERE B_Rank = 9 AND Au_Rank = 9 AND Au_ID = B_ID

C) SELECT Last_Name, First_Name, Title


FROM Books, Authors

D) SELECT Last_Name, First_Name, Title


FROM Books, Authors
WHERE B_Rank = 9 AND Au_Rank = 9 AND Au_ID = B_ID

E) SELECT Authors.Last_Name, Authors.First_Name, Books.Title


FROM Books, Authors
WHERE Books.B_Rank = 9 AND Authors.Au_Rank = 9 AND Authors.Au_ID = Books.Au_ID

Page 6
CSC105 A01 Instructor: Rich Little
23. Still referring to the Entity-Relationship diagram above, what query does the following select statement
answer?

SELECT Title
FROM Books
WHERE (((B_Rank)>=9))

A) Selects all of the book titles in Table Books.


B) Selects all of the book titles in Table Books where the book rank is no higher than 9.
C) Selects all of the book titles in Table Books where the book rank is 9 or higher.
D) Both A and B are correct.
E) Both B and C are correct.

24.You are interviewing for a job in a transportation rental agency. You are shown the following database
query statement:

SELECT Vehicle_Type
FROM All_Rental_Vehicles
WHERE (Transport_Mode = ‘Land’ OR ‘Air’ OR ‘Water’) AND Rental_Price < 25.00

The interviewer says: “You can’t use this type of technical language with the clients. How would you
change this into language that the clients would understand?” You want the job so you reply:

A) This statement will search the database for all types of rental vehicles that can go on land, or air, or
water and cost $25.00 or less to rent.
B) This statement will search the database for all types of rental vehicles that can go on land, and air, and
water and cost $25.00 or less to rent.
C) This statement will search the database for all types of rental vehicles that can go on land, or air, or
water and cost less than $25.00 to rent.
D) This statement will search the database for all types of rental vehicles that can go on land, and air, and
water and cost less than $25.00 to rent.
E) This statement searches the database and tells the clients that a private Lear Jet is the transportation
mode for them.

25.The HTML tag <BODY bgcolor = “#0000FF”> sets the background colour to which colour?
A) Red
B) Green
C) Blue
D) White
E) It is not a valid tag

26. Which one of the following CSS entries does not force the <NAV> element to start on a newline?
A) nav {display: block;}
B) nav {display: right;}
C) nav {display: current;}
D) nav {display: inline;}
E) none of the above

Page 7
CSC105 A01 Instructor: Rich Little
Consider the following diagram for question 27.
2
.

3
.

27. The diagram represents a portion of the execution of a running program. The top of the diagram represents
actions in the CPU, and the bottom represents actions in RAM. What is happening at each of the numbered
components of the diagram?
A) 1. is incrementing the program counter
2. is fetching instructions from RAM into the CPU
3. is performing the task specified in 1 (in this case putting 99 into register A).

B) 1. is fetching instructions from RAM into the CPU


2. is performing the task specified in 1 (in this case putting 99 into register A).
3. is incrementing the program counter.

C) 1. is fetching instructions from RAM into the CPU


2. is incrementing the program counter.
3. is performing the task specified in 1 (in this case putting 99 into register A).

D) 1 is performing the task specified in 1 (in this case putting 99 into register A).
2. is incrementing the program counter.
3. is fetching instructions from RAM into the CPU

E) 1 is performing the task specified in 1 (in this case putting 99 into register A).
2. is fetching instructions from RAM into the CPU
3. is incrementing the program counter.

Page 8
CSC105 A01 Instructor: Rich Little
Consider the following JavaScript for Questions 28 and 29. Assume that it is correctly placed in an HTML
document.

<script LANGUAGE = “JavaScript”>


var w = 123
var x = 456
var y = “123”
var z = “456”
var sum1 = w + x;
var sum2 = y + z;
</script>

28. What is the result of sum1?


A) w + x;
B) y + z;
C) “123456”
D) 579

29. What will be the result of sum2?


A) w + x;
B) y + z;
C) “123456”
D) 579

30.Shown below is a screenshot of an HTML document. The underlined text is a link to the page:
http://www.csc.uvic.ca/~csc105. Which HTML code will produce this page: (your five options are on the
next page.)

Page 9
CSC105 A01 Instructor: Rich Little
A) <HTML>
<HEAD><TITLE>CSC 105 is almost over</TITLE></HEAD>
<BODY>
<p>In <a href=“http://www.csc.uvic.ca/~csc105”>CSC 105</a> you learned:
<OL>
<li>A little about computer hardware</li>
<li>Some HTML and Javascript</li>
<li>How Hackers is a horrible movie</li>
</OL>
</BODY>
</HTML>

B) <HTML>
<HEAD><TITLE>CSC 105 is almost over</TITLE></HEAD>
<BODY>
<p>In <a href=“http://www.csc.uvic.ca/~csc105” src=”CSC 105”> you learned:
<UL>
<li>A little about computer hardware</li>
<li>Some HTML and Javascript</li>
<li>How Hackers is a horrible movie</li>
</UL>
</BODY>
</HTML>

C) <HTML>
<HEAD><TITLE>CSC 105 is almost over</TITLE></HEAD>
<BODY>
<p>In <a href=“http://www.csc.uvic.ca/~csc105” src=”CSC 105”> you learned:
<LIST>
<li>A little about computer hardware</li>
<li>Some HTML and Javascript</li>
<li>How Hackers is a horrible movie</li>
</LIST>
</BODY>
</HTML>

D) <HTML>
<HEAD>CSC 105 is almost over</HEAD>
<BODY>
<p>In <a href=“http://www.csc.uvic.ca/~csc105”>CSC 105</a> you learned:
<UL>
<li>A little about computer hardware</li>
<li>Some HTML and Javascript</li>
<li>How Hackers is a horrible movie</li>
</UL>
</BODY>
</HTML>

E) None of the above


Page 10
CSC105 A01 Instructor: Rich Little

31.Consider the contents of the following www folder.

Found in the HEAD section of the index.html file is the following tag for linking to a CSS.

<link rel="stylesheet" type="text/css" href="mystyle/first_style.css" />

The styles are not working, how can you fix it?

A) Move the file first_style.css into the folder mystyle.


B) Change href="mystyle/first_style.css" to href="Images/first_style.css".
C) Change href="mystyle/first_style.css" to href="first_style.css".
D) Both A) and B) would work.
E) Both A) and C) would work.

32.What does the following statement do?

<INPUT TYPE = "button" VALUE = "Click Here" onclick="alert(‘You clicked me!’) ">

A) It will create a text box with Click Here entered. When the user clicks the mouse, an alert box appears
with the “You clicked me!” message.

B) It will create a button titled Click Here. When the button is clicked, an alert box will appear showing the
“You clicked me!” message.

C) It will create a checkbox called Click Here. When the checkbox is clicked, an alert box will appear
showing the “You clicked me!” message.

D) It will create a method called Click Here. When the method is clicked, an alert box will appear showing
the “You clicked me!” message.

E) It will create a prompt with Click Here entered. When the user clicks the mouse, an alert box appears
with the “You clicked me!” message.

33. On the computer, variables are


A) Memory locations
B) Programs
C) Files
D) Numbers
E) All of the above

Page 11
CSC105 A01 Instructor: Rich Little
34. Imagine that the following cascading style sheet information is correctly entered in a .css file:

body{
width: 95%;
font-family: Arial, "MS Trebuchet", sans-serif;
text-align: center;
background-color:#000000;
}

h1{color: #ff00ff}

header{
width: 75%;
margin: 15px auto;
border: 2px solid #0000ff;
}

Furthermore, imagine that the .css file is correctly referenced in an HTML file. The HTML file contains the
following content in the BODY (all of the other tags - e.g. HTML open and close - are correctly placed) :

......
<body>
<header>
<h1> Hello World!! Welcome to HTML 5 </h1>
</header>
</body>
.......

What would the web page look like in the browser? Choose the best answer of the choices on the next two
pages. (NOTE: In each of the options the text of the heading is magenta and the border of the header is blue)

Page 12
CSC105 A01 Instructor: Rich Little

A)

B)

Page 13
CSC105 A01 Instructor: Rich Little

C)

D)

Page 14
CSC105 A01 Instructor: Rich Little
35.Which of the following is a confirm dialog box in JavaScript? Note, the overall style of the dialog box is
determined by the browser that generates it but the main features do not change.

A)

B)

C)

-- END OF EXAM –

Page 15

You might also like