Web Programming Final

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

C. could indicate either addition or concatenation depending on its operands

In JavaScript, the + operator A. always indicates addition B. always indicates concatenation C. could indicate either addition or concatenation depending on its operands D. (none of the other choices)

C. \n

In JavaScript, the special character sequence used to indicate the start of a new line is A. \\ B. \l C. \n D. \r

B. prompt

In JavaScript, which type of dialog box presents: a message, a text box for user reply, and two buttons ("OK" and "Cancel")? A. ask B. prompt C. query D. (none of the other choices)

D. method

In the following JavaScript statement, the word writeln is a(n) _______________. document.writeln("Hello World"); A. event B. event handler C. object D. method

False

It is good practice to try and duplicate your desktop site onto a mobile device exactly. True False

d. ​embedded

The code: <head> <title>My Website</title> ​ <style> ​ body { background-color: green; } ​ </style> </head> exemplifies a(n) _____ style sheet where the style rule is placed between the opening <style> and closing </style> tags. a. ​inline b. ​linked c. ​external d. ​embedded

True

The command vid.canPlayType is useful when trying to determine what video formats are supported by a browser. True False

True

The commands window.screen.availWidth and window.screen.availHeight will allow the developer to access the exact width and height of the screen their page is being displayed on. True False

d. style rules

The figures above show _____ . a. inline styles b. inheritance c. embedded styles d. style rules

b. ​text-align

The four values of left (the default), center, right, or justify is used by the _____ property. a. ​display b. ​text-align c. ​margin-padding d. ​box-shadow

False

The justify value of the text-align property is used to center content within an element.​ True False

C. &&

The logical "and" operator to evaluate two relational expressions is A. ++ B. -- C. && D. ||

True

The navigator.userAgent command withing JavaScript allows us to access information regarding what browser the pae is being displayed on. True False

False

The sides of the Cascading Style Sheets (CSS) box model is referred to in counter clockwise order: left, right, bottom, and top. True False

all of the above

To create a rectangle, which of the following attributes must be defined? x position y postion width and height all of the above

d. ​#container

To style the div id="container" element, _____ is used as the selector. a. ​%container b. ​:container c. ​.container d. ​#container

True

To track a users mouse coordinates you must first and an Event Listener to the canvas. True False

False

True or False: An external JavaScript must be contained inside an HTML script container, such as <script></script> in the ".js" file. True False

False

True or False: JavaScript is a compiled language like C. True False

False

True or False: JavaScript is a subset of the Java programming language. True False

True

True or False: JavaScript is case sensitive. True False

False

True or False: JavaScript variable names can begin with a letter, numeral or the underscore character. True False

True

Websites developed with Hypertext Markup Language (HTML) 5 alone can be functional, but they lack the important element of visual appeal. True False

D. /* to start and */ to stop

What character or characters enclose a multi-line comment in a JavaScript? A. standard (double) quotes (") B. a pair of double slashes (//) C. <!-- to start and --> to stop. D. /* to start and */ to stop

C. document.write("Hello World");

What is the correct JavaScript syntax to send the source code "Hello World" to the browser? A. print ("Hello World"); B. printf ("Hello World"); C. document.write("Hello World"); D. response.write("Hello World");

C. Amount:24

What output will be produced by the following JavaScript statement: document.write("Amount:"+2+4); A. Amount:2+4 B. Amount:6 D. (none of the other choices)

False

When a style is changed in an embedded stylesheet, it automatically applies the change to every page linked to that style sheet. True False

True

When an image is floated to the right or left of elements containing text content, the effect is to wrap the text around the image. True False

window.innerWidth;

When setting the size of your canvas, it is preferable to use the _______ command to set the canvas width. window.inner; window.width; window.innerWidth; inner.canvasWidth;

a. absolute

When the CSS property of position is set to ____ it moves the element relative to its original position and allows other elements to flow into the space that the absolutely positioned element would have otherwise occupied. a. absolute b. relative c. right d. left

vid=!!document.createElement('video').canPlayType;

Which JavaScript command will allow us to store a boolean value in the variable vid, to help determine if a browser can play HTML5 video? vid=!!document.createElement('video').canPlayType; vid=document.createElement('video').canPlayType; vid=!!doc.createElement('video').playType; none of the above

A. if (n != 0)

Which JavaScript syntax should be used to start a conditional statement for executing a command only if "n" is NOT equal to 0? A. if (n != 0) B. if <>0 C. if =! 0 then D. if (n <> 0)

B. if (n==2)

Which JavaScript syntax should be used to start a conditional statement for executing a command only if "n" is equal to 2? A. if n=2 then B. if (n==2) C. if n=2 D. if n==2 then

contenteditable

Which of the following attributes allows a user to modify content within a page element? editcontent contenteditable changecontent contentmanipulate contentmanipulate

context.fillText('Hello World!', 150, 100);

Which of the following commands will display text onto a HTML5 canvas? context.writeText('Hello World!', 150, 100); context.type('Hello World!', 150, 100); context.fill('Hello World!', 150, 100); context.fillText('Hello World!', 150, 100);

context.clearRect(0,0,canvas.width,canvas.height);

Which of the following commands will fully erase all contents from the HTML5 canvas? context.clearRect(0,0,canvas.width,canvas.height); context.eraseRect(0,0,canvas.width,canvas.height); context.clear(0,0,width,height); context.erase(canvas);

<a href="tel:+18005550122">

Which of the following href commands will allow a user to successfully dial a specific number if viewing your page on a mobile phone? <a href="tel:+18005550122"> <a href="telephone:+18005550122"> <a href="call:+18005550122"> <a href="phone:+18005550122">

B. do...while

Which of the following is a JavaScript loop (repetition) statement pair A. do...until B. do...while C. for...do D. while...repeat

A. =

Which of the following is not a valid comparison (relational) operator? A. = B. < C .> D. !=

C. 12footage

Which of the following is not a valid variable name in JavaScript? A. Tax1 B. eightball_8 C. 12footage D. pageNumber1200

D. switch

Which of the following is the JavaScript keyword to start a flow control structure that chooses from multiple alternative processes based on the value of a single expression? A. break B. case C. for D. switch

B. JavaScript is case-insensitive

Which of the following statements about JavaScript syntax is false? A. The statement terminator/separator symbol is a semi-colon B. JavaScript is case-insensitive C. Anything on a line following the symbols // will be interpreted as a comment D. You can have a comment that spans multiple lines, if enclosed within /* and */

The code: <head> <title>My Website</title> ​ <style> ​ body { background-color: green; } ​ </style> </head> exemplifies a(n) _____ style sheet where the style rule is placed between the opening <style> and closing </style> tags.

embedded

b. ​style

A _____ is a rule that defines the appearance of an element on a webpage. a. ​cascade b. ​style c. ​semantic d. ​syntax

d. There is no limit.

A single HTML element is limited to ____ attributes. a. 24 b. 48 c. 96 d. There is no limit.

True

A site's orientation can be changed through the use of CSS alone, no JavaScript needed. True False

True

An embedded style sheet takes precedence over an external style sheet. True False

False

An external style sheet is used when one wants to create styles for a single webpage that are different from the rest of the website. True False

True

Block elements can contain inline elements. True False

False

Both the align-content and align-items properties have a default value of center. True False

a. position

CSS lets you specify the exact position of an element on a web page using the ____ property. a. position b. grid c. ruler d. location

True

Creating and modifying page layouts in CSS involves specifying size and position information for web page elements. True False

B. //This is a comment

How do you indicate a comment of "This is a comment" in a JavaScript? A. 'This is a comment B. //This is a comment C. <!--This is a comment--> D. rem This is a comment

context.moveTo(100,100);

Examine the following code: var context = canvas.getContext('2d'); context.beginPath(); context.moveTo(100,100); context.lineTo(300,300); context.quadraticCurveTo(230,200, 250,120); Which command re-positions the drawing point without actual drawing anything to the screen? context.beginPath(); context.moveTo(100,100); context.lineTo(300,300); context.quadraticCurveTo(230,200, 250,120);

coordinates

Examine the following command: context.drawImage(img, 100, 150); What do the values 100 and 150 represent? width and height coordinates rotations none of the above

False

External styles defeat the purpose and advantages of separating style from content, so they should be used sparingly. True False

A. myFunction();

How do you call a function named "myFunction" without passing any data to it? A. myFunction(); B. call function myFunction; C. call myFunction(); D. (none of the other choices)

C. function myFunction();

How do you declare a function named "myFunction" that receives no passed data? A. function:myFunction(); B. function=myFunction(); C. function myFunction(); D. (none of the other choices)

True

JavaScript has only one type of numeric variable, but it can be used to store integer or floating point numbers. True False

True

Linked style sheets do not contain any Hypertext Markup Language (HTML) tags True False

False

Margin is the space inside a border between the border and the element content. _________________________ True False

transform

One method of moving the position of an HTML5 canvas is to use the CSS3 property ________. move position transition transform

True

Style rules are lines or blocks of CSS code that specify the presentation of web page elements. True False

a. href

The ____ attribute specifies the filename of the external style sheet. a. href b. hsource c. ref d. source

c. ​float

The _____ property allows the positioning of an element to the right or left of other elements. a. ​margin b. ​display c. ​float d. text-align

canvas

The _______ element in HTML5 can be used to draw graphics via scripting in JavaScript. draw paint canvas none of the above

False

The best practice is to apply an inline style sheet when one wants to change the style of one page. True False

B. braces (a.k.a. "curly brackets") { }

The body of statements to be executed in a JavaScript function is enclosed in A. square brackets [ ] B. braces (a.k.a. "curly brackets") { } C. parentheses ( ) D. quotes " "

C. You can assign a value to an undeclared variable and then declare it after that

Which of the following statements about declaring JavaScript variables is true? A. A variable must be declared before it can be used B. You can re-declare a variable, but it will lose its original value C. You can assign a value to an undeclared variable and then declare it after that D. (none of the other choices)

D. (none of the other choices)

Which of the following statements about passing data to or from JavaScript functions is false? A. You can pass more than one value into a JavaScript function B. You can return a value from JavaScript function C. A JavaScript function does not have to receive or return any values D. (none of the other choices)

D. Once data has been assigned to a JavaScript variable, only that data type may be stored in the variable

Which of the following statements about variable declaration in JavaScript is false? A. JavaScript allows the use of a variable that has not been declared B. JavaScript allows more than one variable to be declared on the same line C. JavaScript allows a variable to be declared and assigned in the same statement D. Once data has been assigned to a JavaScript variable, only that data type may be stored in the variable

<time datetime="2015-06-01" ></time>

Which of the following tags will display the full calender date in YYYY-MM-DD format? <time="2015-06-01" ></time> <time datetime="2015-06-01" ></time> <time date="2015-06-01" ></time> none of the above

D. (all of the above)

Which of the following techniques can be used to add JavaScript to a web page? A. Embed the JavaScript within a script element anywhere in the body section. B. Embed the JavaScript within a script element anywhere in the head section. C. Link to JavaScript stored separately in an external file. D. (all of the above)

B. body

Which part of a counting loop is not enclosed inside the parentheses in a for loop? A. initialization C. increment/decrement D. test

b. ​inline

With a(n) _____ style, one adds a style to the start tag for an element. a. ​semantic b. ​inline c. ​external d. ​embedded

a.font-weight

You can make text bold using the ____ property. a. font-weight b. font-style c. Either A or B. d. Neither A nor B.

a. ​Cascading Style Sheets

_____ is a language used to describe the formatting of a document written in a markup language such as Hypertext Markup Language (HTML) 5. a. ​Cascading Style Sheets b. ​Designing Style Sheets c. ​Web paging Style sheets d. ​Segregation Style Sheets

False

here is a limit of 100 element types that can be included in a single rule. True False

False

​In the context of style sheet precedence, external styles beat embedded styles and embedded styles beat inline styles. True Fasle False


Set pelajaran terkait

Care of the Patient with an Integumentary Disorder

View Set

Pharmacology UNIT 1: Quizzes/Assignments

View Set

PrepU ch. 37 urinary elimination

View Set

Paramedic Airway FISDAP Review Part 1

View Set

Chapter 16 - Regulation of Organic Metabolism and Energy Balance

View Set

Chapter 1: Nerve Cells and Nerve Impulses

View Set

Mental Health Unit 3: Schizophrenia-3

View Set