CS 212 midterm quiz

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

What does HTML stand for? Hyper Text Markup Language How to Make Lasagna Hyperlinks and Text Markup Language Hot Mail Home Tool Markup Language

Hyper Text Markup Language

Which protocol assigns a unique address to a connected device? UniqueProt IP SingleAdd TCP

IP

Where in an HTML document is the correct place to refer to an external style sheet? In the <style> section In the <head> section At the end of the document In the <body> section

In the <head> section

Choose the correct HTML element for the largest heading: <h1> <heading> <head> <h6>

<h1>

What is the correct HTML element for playing video files? <movie> <media> <video> <vid>

<video>

Which of the following is a component of CSS style rule? Selector Property Value All of the other answers.

All of the other answers.

Where is the correct place to insert a JavaScript? Both the <head> section and the <body> section are correct The <head> section Inside the <code> section The <body> section

Both the <head> section and the <body> section are correct

What does CSS stand for? Color Style Sheets Cascade Sheets Style Cascade Style Sheet Cascading Style Sheets

Cascading Style Sheets

Why so JavaScript and Java have similar name? They both originated on the island of Java JavaScript's syntax is loosely based on Java's

JavaScript's syntax is loosely based on Java's

In CSS, what can h1 be called? Attribute Selector Value Tag

Selector

The _______ method of an Array object adds and/or removes elements from an array. Slice Splice Shift Reverse

Splice

What should appear at the very end of your JavaScript? The </script> tag The <script> tag The END statement

The </script> tag

When a user views a page containing a JavaScript program, which machine actually executes the script? The Web server The User's machine running a Web browser A DNS machine A central machine deep within JavaScript's corporate offices

The User's machine running a Web browser

Which protocol is used to relay packets from a device to another device? Packet Relay Protocol Internet Relay Protocol Transmission Control Protocol Simple Transfer Protocol

Transmission Control Protocol

Which of the following options is true about algorithms? Algorithms are described informally and can contain ambiguous steps. Algorithms are written in a programming language. Algorithms can replace the source code in programs. You must create an algorithm for a problem before you can create a program to solve the problem.

You must create an algorithm for a problem before you can create a program to solve the problem.

The expression a===b tests whether a and b are equal in value and type There is no such expression a and b are equal in value a and b are equal in value, type and reference address

a and b are equal in value and type

How do you write "Hello World" in an alert box? msg("Hello World"); alertBox("Hello World"); msgBox("Hello World"); alert("Hello World");

alert("Hello World");

Coding conventions suggest positioning the style element (with CSS rules) inside a body element an html element a head element a header element

an html element

The input to a method is called a(n) _______________. overloaded argument interface procedure

argument

What term is used to refer to values supplied to a method that are needed to carry out its task? class object argument comment

argument

Which CSS property is used to change the background color? color-background background-color bgcolor colorbg

background-color

Which is the correct CSS syntax? {body;color:black;} body:color=black; body {color: black;} {body:color=black;}

body {color: black;}

The type of an object is given by its ______ ? variable method reference class

class

Which of the following property is used to change the face of a font? font-family font-style font-variant font-weight

font-family

Which CSS property is the bold value associated with? font-style font-variant font-weight font-lettering

font-weight

How do you add a background color for all <h1> elements? h1 {background-color:#FFFFFF;} h1.all {background-color:#FFFFFF;} all.h1 {background-color:#FFFFFF;} h1:all {background-color:#FFFFFF;}

h1 {background-color:#FFFFFF;}

________ selectors are used to specify a rule to bind to a particular unique element. class tag id element

id

Which term is used to describe the name of a variable, method, or class? type literal identifier label

identifier

How to write an IF statement for executing some code if "i" is NOT equal to 5? if i =! 5 then if i <> 5 if (i <> 5) if (i != 5)

if (i != 5)

Which of the following property allows you to control the shape or appearance of the marker of a list? list-style-position list-style-type list-style-image list-style

list-style-type

Which property is used to obtain browser vendor and version information? browser navigator version modal

navigator

Which event occurs when the user clicks on an HTML element? onchange onmouseover onclick onmouseclick

onclick

HTTP uses pairs of in-bound messages and out-pound messages requests and responses Packets and datagrams HTML and CSS files

requests and responses

The method or operator used to identify the array is typeof == isarrayType() ===

typeof

How can you add a comment in a JavaScript? 'This is a comment //This is a comment <!--This is a comment-->

//This is a comment

Consider the following code snippet : var a = []; a.unshift(1); a.unshift(22); a.shift(); a.unshift(3,[4,5]); a.shift(); a.shift(); a.shift(); The final output will be [4,5] Error [3,4,5] 1

1

How many tags are in a regular element? 2 3 4 5

2

Evaluate the given pseudocode to calculate the weighted score for a student: The homework score (homework) = 95 The weight of homework (hwWeight) = 35% The exam score (exams) = 87 The weight of exams(exWeight) = 65% input homework input hwWeight input exams input exWeight output homework*hwWeight + exams*exWeight What is the final output? 89.20 89.80 87.80 92.20

89.80

How to write HTML comment ? // This is HTML comment /* This is HTML comment */ <!-- This is HTML comment --> <comment> This is HTML comment </comment>

<!-- This is HTML comment -->

Which tag would you use to create a hyperlink? <a> <link> <hlink> <anchor>

<a>

When we need to create ordered list which markup we need to use? <ordlist> <ol> <olist> <list>

<ol>

Inside which HTML element do we put the JavaScript? <javascript> <scripting> <js> <script>

<script>

Which HTML tag is used to define an internal style sheet? <css3> <style> <script> <css>

<style>

Which of these elements are all <table> elements? <table><head><tfoot> <table><tr><td> <thead><body><tr> <table><tr><tt>

<table><tr><td>

Which statement best describes a computer program? A program is a sequence of comments. A program can decide what task it is to perform. A program is a sequence of instructions and decisions that the computer carries out. A program can only perform one simple task.

A program is a sequence of instructions and decisions that the computer carries out.

What is a logic error? A violation of the rules of the computer language. A missing main method. A program that is syntactically correct but does not do what it is supposed to do. An error that is so severe that it generates an exception.

A program that is syntactically correct but does not do what it is supposed to do.

What is an example of a typical instruction in a computer program? Add up two numbers. Lay out a term paper. Drive a car. Display a fancy font.

Add up two numbers.

What is an object? A sequence of instructions. Any value stored in a variable. An entity in your program that is manipulated by calling methods. Any input to a method.

An entity in your program that is manipulated by calling methods.

Which statement regarding computer programs is correct? Computer programs can decide what task to perform. Large and complex computer programs are generally written by only one programmer. Computer programs are composed of extremely primitive operations. Small computer programs are not documented.

Computer programs are composed of extremely primitive operations.

JavaScript is the same as Java. True or False

False

Consider the following code snippet : var a = [1,2,3,4,5]; a.slice(0,3); What is the possible output for the above code snippet ? Returns [1,2,3]. Returns [1,2,3,4]. Returns [1,2,3,4,5]. Returns [4,5]

Returns [1,2,3].

Which statement about methods is true? A method must return a value The return value of a method must be stored in a variable Some methods carry out an action; others return a value All methods require multiple arguments

Some methods carry out an action; others return a value

What is the purpose of the following algorithm? input num Repeat the following steps for 9 times input var1 if var1 > num then num = var1 print num To print out the 10 numbers To search for a particular number among 10 numbers To find the largest among 10 numbers To find the smallest among 10 numbers

To find the largest among 10 numbers

Inline elements are normally displayed without starting a new line. True or False

True

What term is used to refer to an individual instruction inside a method? statement constant comment object

statement

What is the function of the tag below? <title> This tag </title> stores meta information about the title shows the server how to index the website stores the title of the website for the browser and search engine results shows the server how to title the website

stores the title of the website for the browser and search engine results

What term is used to refer to a sequence of characters enclosed in quotation marks? string object comment variable

string

What is the correct way to write a JavaScript array? var colors = 1 = ("red"), 2 = ("green"), 3 = ("blue"); var colors = ["red", "green", "blue"]; var colors = "red", "green", "blue"; var colors = (1:"red", 2:"green", 3:"blue");

var colors = ["red", "green", "blue"];

What is a storage location in the computer's memory called that has a type, name, and contents? identifier literal label variable

variable

How does a WHILE loop start? while (i <= 10) while (i <= 10; i++) while i = 1 to 10

while (i <= 10)

What term is used to refer to text in a program that is an explanation for human readers of the code? methods comments constants [* and *]

comments

What is the correct HTML for inserting an image? <image src="image.gif" alt="MyImage"> <img alt="MyImage">image.gif</img> <img src="image.gif" alt="MyImage"> <img href="image.gif" alt="MyImage">

<img src="image.gif" alt="MyImage">

What is the correct HTML code for referring to an external style sheet? <style src="mystyle.css"> <link rel="stylesheet" type="text/css" href="mystyle.css"> <style link="mystyle.css"> <stylesheet>mystyle.css</stylesheet>

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

What does CPU stand for? Computer Programming Unit Computer Processing Unit Central Processing Unit Central Programming Unit

Central Processing Unit

What is an element that does not having a closing tag called? Empty element Closed element Endless element

Empty element

How do you select an element with id "demo"? .demo #demo *demo demo

#demo

How do you select elements with class name "test"? *test #test .test test

.test

What is the correct HTML for creating a hyperlink? <a http="www.nau.edu"> Northern Arizona University </a> <a href="www.nau.edu"> Northern Arizona University </a> <a url="www.nau.edu"> Northern Arizona University </a> <a link="www.nau.edu"> Northern Arizona University </a>

<a href="www.nau.edu"> Northern Arizona University </a>

What is the purpose of the following algorithm? input somenum Repeat the following steps for 14 times input variable1 if variable1 < somenum then somenum = variable1 print somenum To search for a particular number among 15 numbers. To find the largest among 15 numbers. To print out the 15 numbers. To find the smallest among 15 numbers.

To find the smallest among 15 numbers.

What is the term used to describe an error detected by the compiler that is a violation of the programming language rules? logic error compile-time error run-time error typo

compile-time error

What is the correct JavaScript syntax to change the content of the HTML element below? <p id="demo">This is a demonstration.</p> #demo.innerHTML = "Hello World!"; document.getElement("p").innerHTML = "Hello World!"; document.getElementByName("p").innerHTML = "Hello World!"; document.getElementById("demo").innerHTML = "Hello World!";

document.getElementById("demo").innerHTML = "Hello World!";

Consider the following code snippet for(var p in o) console.log(o[p]); The above code is equivalent to which code? for (var i = 0;i < a.length;i++) console.log(a[i]); for (var i = 1;i < a.length;i++) console.log(a[i]); for (int i = 0;i < a.length;i++) console.log(a[i]); for (var i = 0;i <= a.length;i++) console.log(a[i]);

for (var i = 0;i < a.length;i++) console.log(a[i]);


Ensembles d'études connexes

PEDS Test 3 Sherpath - Common Infections of the Respiratory Tract

View Set

Sadlier-Oxford Vocab Level H - Unit 3

View Set

Crime Scene Investigation quiz Chps 10-12

View Set

how to say hello in 15 diffrent languages

View Set

FTCE Elementary Education K-6 Math/ELA/S/SS

View Set

Bio HW 6 (Ch. 38), Ch 54, CH37-COMMUNITY AND ECOSYSTEM ECOLOGY, Chapter 37, 1041SCG Biological Systems Week 12, Ecology CH. 12 Book Online Question, quiz 5, Chapter 38, Biology Ch. 42 and 43, Ecology Exam, BSC2011L Chapter 53 Q A, Chapter 53 practice...

View Set

IMC Test 3 chapter 8 Sample Questions

View Set

Ch 39 Management of Patients with Oral and Esophageal Disorders

View Set