• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/81

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

81 Cards in this Set

  • Front
  • Back

You would like to create a web application by using HTML5, JavaScript, and CSS3.
Which of the following Visual Studio 2012 editions can you use? (Choose all that apply.)
A. Visual Studio Professional 2012
B. Visual Studio Premium 2012
C. Visual Studio Ultimate 2012
D. Visual Studio Express 2012 for Web
E. Visual Studio Express 2012 for Windows 8

Correct answers: A, B, C, and D




A. Correct: Visual Studio Professional 2012 provides web templates for creating web
applications.
B. Correct: Visual Studio Premium 2012 provides web templates for creating web
applications.
C. Correct: Visual Studio Ultimate 2012 provides web templates for creating web
applications.
D. Correct: Visual Studio Express 2012 for Web provides web templates for creating
web applications only.
E. Incorrect: Visual Studio Express 2012 for Windows 8 provides templates for build-
ing Windows 8 applications only.

You would like to create a Windows 8 application by using HTML5, JavaScript, and
CSS3. Which of the following Visual Studio 2012 editions can you use? (Choose all
that apply.)
A. Visual Studio Professional 2012
B. Visual Studio Premium 2012
C. Visual Studio Ultimate 2012
D. Visual Studio Express 2012 for Web
E. Visual Studio Express 2012 for Windows 8

Correct answers: A, B, C, and E
A. Correct: Visual Studio Professional 2012 provides web templates for creating
Windows 8 applications.
B. Correct: Visual Studio Premium 2012 provides web templates for creating
Windows 8 applications.
C. Correct: Visual Studio Ultimate 2012 provides web templates for creating
Windows 8 applications.
D. Incorrect: Visual Studio Express 2012 for Web provides web templates for creating
web applications only.
E. Correct: Visual Studio Express 2012 for Windows 8 provides templates for building
Windows 8 applications only.

You would like to create web applications and Windows 8 Windows Store applications
by using HTML5, JavaScript, and CSS3, but while you’re learning, you don’t want to buy
Visual Studio 2012. Which of the following Visual Studio 2012 editions can you use for
free to accomplish your goal?
A. Visual Studio Professional 2012
B. Visual Studio Premium 2012
C. Visual Studio Ultimate 2012
D. Visual Studio Express 2012 for Web and Visual Studio Express 2012 for Windows 8

Correct answer: D



A. Incorrect: Visual Studio Professional 2012 enables you to create web and
Windows 8 applications, but it is not free.
B. Incorrect: Visual Studio Premium 2012 enables you to create web and Windows 8
applications, but it is not free.
C. Incorrect: Visual Studio Ultimate 2012 enables you to create web and Windows 8
applications, but it is not free.
D. Correct: Visual Studio Express 2012 for Web provides web templates for creating
web applications, and Visual Studio Express 2012 for Windows 8 provides tem-
plates for creating Windows 8 applications. Both are free.

You would like to create a Windows 8 application by using Blend and HTML5,
JavaScript, and CSS3. Which feature of Blend enables you to pause an application when
it reaches a desired state so you can set the style rules for the page and its controls
while in this state? (Choose all that apply.)
A. Assets panel
B. Projects panel
C. Visual Design
D. Interactive mode

Correct answers: C and D



A. Incorrect: The Assets panel enables you to access a list of the HTML elements, con-
trols, and media that can be added to an HTML page that is open in the artboard.
B. Incorrect: The Projects panel provides a file and folder view of the projects in the
current solution.
C. Correct: With Visual Design, what you see in Blend is what users will see in
Windows 8.
D. Correct: Interactive mode enables you to run the application on the design surface
until the desired state is reached. You can pause the application and then style the
application for the new state.

On which panel can you see a hierarchically structured view of the DOM?
A. Live DOM
B. Projects
C. Assets
D. Device

Correct answer: A



A. Correct: Live DOM displays the structure of the current document as a hierarchi-
cal representation. You can use the Live DOM panel to select elements and adjust
their style rules.
B. Incorrect: The Projects panel provides a file and folder view of the projects in your
solution.
C. Incorrect: The Assets panel lists all the HTML elements, controls, and media that
you can add to an HTML page that is open in the artboard.
D. Incorrect: The Device panel enables you to configure your display so that you can
visualize your application accurately on a variety of displays.

Which panel can you use to access a list of the HTML elements, controls, and media
that can be added to an HTML page that is open in the artboard?
A. Projects
B. Assets
C. Device
D. Live DOM

Correct answer: B



A.Incorrect: The Projects panel provides a file and folder view of the projects in your
solution.
B. Correct: The Assets panel lists all the HTML elements, controls, and media that you
can add to an HTML page that is open in the artboard.
C. Incorrect: The Device panel enables you to configure your display so that you can
visualize your application accurately on a variety of displays.
D. Incorrect: The Live DOM panel displays the structure of the current document as
a hierarchical representation. You can use the Live DOM panel to select elements
and adjust their style rules.

You want to create an expando attribute on several

tags that display vehicles for
sale. The expando attribute will store the VIN (vehicle identification number) of the
vehicle for sale. Which of the following is the most appropriate example of creating the
expando attribute?
A. 1965 VW Beetle
B. 1965 VW Beetle
C. 1965 VW Beetle
D. 1965 VW Beetle

Correct answer: C



A. Incorrect: Although this example would work today, it’s possible that a vin attri-
bute could be introduced by a future version of HTML that would cause a conflict.
B. Incorrect: You cannot use the id attribute as an expando attribute because the id
attribute is already defined by the HTML5 specification to provide a unique identi-
fier to an element.
C. Correct: This is a properly defined expando attribute that will not conflict with
attributes introduced by future versions of HTML because the attribute name is
prefixed with “data-“ as required by the HTML specification.
D. Incorrect: Although this example would work today, it’s possible that a vin attri-
bute could be introduced by a future version of HTML that would cause a conflict.

Which technology is HTML5 preceded by and derived from?
A. HTML 4.01
B. SGML
C. XHTML 1.0
D. XML

Correct answer: A



A. Correct: HTML5 is preceded by and derived from HTML 4.01.
B. Incorrect: Although HTML’s root is SGML, which means that HTML5 is derived
from SGML, HTML5 is preceded by HTML 4.01.
C. Incorrect: Although XHTML 1.0 was released after HTML 4.01, HTML5 does not
inherit from XHTML1.0.
D. Incorrect: Although XHTML1.0 inherits from XML, HTML5 does not.

How should you start each HTML5 document?
A.
B.


C.
D.

Correct answer: D



A. Incorrect: The element is the root element for your HTML5 document, but
it should be listed after you indicate the document type to the browser.
B. Incorrect: The

tag must be contained within the element, so it
cannot be located at the beginning of the HTML5 document.
C. Incorrect: The tag must be contained within the element, so it can-
not be located at the beginning of the HTML5 document.
D. Correct: The indicates to the browser that this is an HTML5
document.

You want to use the disabled Boolean attribute on a text box. How can you accomplish
this? (Choose all that apply.)
A.
B.
C.
D.

Correct answers: A, B, and D



A. Correct: The use of disabled by itself, with no value, is the minimized method for
implementing Boolean attributes.
B. Correct: The use of disabled with an empty value is one way to implement Boolean
attributes by using quoted form.
C. Incorrect: The use of disabled with a value of true is not an acceptable way to
implement Boolean attributes.
D. Correct: The use of disabled with a value that is the same as the attribute name is
one way to implement Boolean attributes by using quoted form.

You want to embed a Flash file called myFlash.swf in your HTML document. Which is
the most appropriate code?
A.
B.
C.
D.

Correct answer: D



A. Incorrect: The element creates a hyperlink.
B. Incorrect: The element creates an inline frame that references another
HTML document.
C. Incorrect: The element embeds an image in the current HTML document.
D. Correct: The element embeds an object such as a Flash file in the current
HTML document.

You want to create a drawing of a machine that Contoso, Ltd., will be selling on its
website. The drawing will be embedded in your HTML document, and you want it to
maintain its quality when resized. Which is the most appropriate file type to use?
A. SVG
B. GIF
C. JPG
D. PNG

Correct answer: A



A. Correct: The SVG file type is used to create Scalable Vector Graphics, which scale
well while maintaining quality.
B. Incorrect: The GIF file type is best for small images with limited colors, but it is
raster-based and does not scale well.
C. Incorrect: The JPG file type is best for photos when millions of colors are used and
high compression is desirable, but it is raster-based and does not scale well.
D. Incorrect: The PNG file type is best for photos when millions of colors are used
and medium no-loss compression is desirable, but it is raster-based and does not
scale well.


Your application prompts the user to enter his or her age, which is placed in an age
variable. A user ran the application and entered I Don’t Know for the age. The applica-
tion then multiplies age by two. What is the result?
A. undefined
B. null
C. NaN
D. infinity

Correct answer: C



A. Incorrect: The undefined value means that the variable has never been initialized.
B. Incorrect: The null value means that the variable was explicitly set to have no
value.
C. Correct: When performing a mathematical operation on a nonnumeric value, NaN
(not a number) will result.
D. Incorrect: The Infinity value will result when your value exceeds
1.7976931348623157E + 10308.

Which of the following represent valid variable declarations? (Choose all that apply.)
A. var switch;
B. var myChar;
C. var $cost;
D. var _total;
E. var 1to1;
F. var tooGood4u;

Correct answers: B, C, D, and F



A. Incorrect: You cannot use a JavaScript keyword for a variable name, and switch is a
JavaScript keyword.
B. Correct: The myChar variable name is valid.
C. Correct: JavaScript allows a variable name to contain the dollar sign, so the $cost
variable name is valid.
D. Correct: JavaScript allows a variable name to contain the underscore, so the _total
variable name is valid.
E. Incorrect: Variable names cannot begin with a number.
F. Correct: Variable names can contain numbers but cannot begin with a number.

In your application, you want to display a personalized message to the user, if the
user’s name is populated, in the userName variable, but if userName is empty, you
want to use Valued User instead. How can you accomplish this most efficiently?
A. var personalized = ‘Hello ‘ + (userName ?? ‘Valued User’);
B. var personalized = ‘Hello ‘ + (userName || ‘Valued User’);
C. var personalized = ‘Hello ‘ + (userName && ‘Valued User’);
D. var personalized = ‘Hello ‘ + (userName + ‘Valued User’);

Correct answer: B



A. Incorrect: The use of ?? causes a syntax error.
B. Correct: The use of || causes Valid User to be displayed if userName has no value.
C. Incorrect: The use of && displays nothing if userName has no value.
D. Incorrect: The use of + causes Valid User to be displayed if userName has no value,
but it also displays the userName and Valid User together when the userName has
a value.

You are creating a new Windows 8 application, and you want to set up TDD for your
JavaScript code. Which testing framework will you use?
A. QUnit
B. QUnit-Metro
C. Microsoft Test
D. NUnit

Correct answer: B



A. Incorrect: QUnit is for testing JavaScript for the web, not Windows 8.
B. Correct: QUnit-Metro is a variation of QUint, which supports Windows 8.
Answers CHAPTER 3 135
C. Incorrect: Microsoft Test does not support JavaScript.
D. Incorrect: NUnit does not support JavaScript.

What are the steps for TDD?
A. Write the passing test, write the code, run the test again to validate that it still
passes.
B. Write the failing test, write the code, run the test again to validate that it passes.
C. Write the code, write the test to validate that it passes, run the test again to vali-
date that it still passes.
D. Write the passing test, write the code, break the code, run the test again to vali-
date that it fails.

Correct answer: B



A. Incorrect: You need to write a failing test first so you can see the test pass after
you write the code.
B. Correct: You write a failing test and then write code that makes the test pass; then
run the test again to validate that it passes.
C. Incorrect: You should never write code without first writing a test that fails.
D. Incorrect: If you write a passing test first, the code cannot be tested for success.

Where should your JavaScript code be placed?
A. In the

element of your HTML document.
B. Just before the tag.
C. You should always place your JavaScript code in separate files, external to your
HTML document.
D. Inside the element, at the top.

Correct answer: C



A. Incorrect: Placing your JavaScript code in the

element does not promote
reuse, and inline code might reference elements that are not yet loaded.
B. Incorrect: Placing your JavaScript code in the tag does not promote
reuse.
C. Correct: Placing your JavaScript code in separate files, external to your HTML
document, promotes reuse.
D. Incorrect: Placing your JavaScript code in the element does not promote
reuse, and inline code might reference elements that are not yet loaded.

You have two arrays of strings, customers and employees, and you want to combine
them to create a contacts array. Which method would be most suitable for this task?
A. concat
B. join
C. push
D. splice

Correct answer: A



A. Correct: Concat concatenates multiple arrays and produces a resultant array.
B. Incorrect: Join creates a string from the items in the array.
C. Incorrect: Push adds a single item to the end of the array.
D. Incorrect: Splice adds and removes items from an array and produces a resultant
array, but you must add the items one by one, not as an array.

You want to obtain a list of all elements whose tag name is div, and you need to
retrieve this list as quickly as possible. Which function is most appropriate for this task?
A. getElementsByName
B. querySelectorAll
C. getElementsByTagName
D. getElementsByClass

Correct answer: C



A. Incorrect: getElementsByName retrieves a live NodeList of elements based on the
element’s name attribute, not on the tag name.
B. Incorrect: querySelectorAll is capable of retrieving the elements by tag name, but
returns a static NodeList, which does not perform as well as functions that return a
live NodeList.
C. Correct: getElementsByTagName retrieves a live NodeList of elements based on
the element’s tag name.
D. Incorrect: getElementsByClass retrieves a live NodeList of elements based on the
CSS class name

The free editions of Visual Studio 2012 are

the Express editions: Visual Studio
Express 2012 for Web and Visual Studio Express 2012 for Windows 8.

MS blend Assets panel contains

a list of all available assets in the project.

MS blend Projects panel contains

a file and folder view of the projects in the current solution.

MS blend Style Rules panel contains

a list of all style sheets attached to the current
document.

MS blend Device panel enables you to

run the application by using simulations of different screen sizes and orientations.

MS blend Live DOM panel enables you to

select an element and apply style rules to it.

An html element is composed of

a starting tag, inner content, and an ending tag.

Browsers ignore tags

that are not recognized.

HTML5 originates from

HTML 4.01, not from XHTML.

The W3C is responsible for

developing open standards for the web.

HTML elements provide_____,


CSS style sheets provide_____,


JavaScript provides _________

HTML elements provide structure, CSS style sheets provide presentation, and
JavaScript provides behavior.

Attribute values should always be

quoted using either single quotes or double quotes.

Self-closing tags are

tags whose beginning and ending tags are together to create an
element with no content.

Self-closing tags should be used only

with elements that can-
not have content.

Void elements cannot have

content

Expando attributes are

attributes that you define and are also known as author-
defined attributes or custom attributes. Prefix these attributes with “data-“.

Are there conditional comments in html?

You can use conditional comments to add a browser-specific source that will work with
Internet Explorer but be treated as a comment by other browsers.

HTML entities are

special characters and can be embedded in your HTML document
by using the ampersand (&), the entity name, and a semicolon (;). You can also use the
ampersand (&), the hash symbol (#), the entity number, and the semicolon (;).

Nonbreaking spaces can be used to

ender several contiguous spaces. You can also use
nonbreaking spaces to keep two words from being separated by a line break.

id attribute specifies

a unique identifier for an element.

You can use the element to

provide reuse of HTML by embedding an HTML
document in your current HTML document.

Use the sandbox attribute on the tag to help

prevent malware and annoy-
ances such as pop-ups from being introduced when the content is embedded in your
HTML page.

Use the seamless attribute on the tag to

indicate that the source content is to
be rendered to appear as though it’s part of the containing document.

The tag creates a

hyperlink to either an external HTML document or an internal
location in the current document. The tag can also be used to send email
messages.

The element is

a void element and is used to add an image reference to your
HTML document.

JPG is best for displaying

photos on HTML pages due to its compression

GIF is best
for

small images with transparency and embedded animations

PNG is best for

storage
due to lossless compression during editing sessions

SVG is best for

drawings due
to its vector drawing scalability.

You can create a clickable image map by

using the and elements.

You can use the tag to

provide simple content embedding.

You can use the tag to

provide content embedding with greater flexibility because it can have nested elements.

JavaScript is untyped. Which means....

when you create a variable, you don’t need to specify its type.

JavaScript defines the following built-in objects:

the global object,


the Object object,
the Function object,


the Array object,


the String object,


the Boolean object,


the Number object,


the Math object,


the Date object,


the RegExp object,


the JSON object,
and several types of Error objects.

In JavaScript, all numeric values are internally represented as

floating point values

The typeof operator is a ________


that returns a string that indicates the ______

The typeof operator is a unary operator that returns a string that indicates the oper-
and’s type.

Use __________for variable names.

Use camel casing for variable names.

Scoping is the context within a computer program in which a variable name

is valid
and can be used to access the variable.

In JavaScript, there are essentially two scopes

global and local, but you can create
nested local scopes by nesting functions.

Use two equal signs (==) to test for

equality

use three equal signs (===) to test for

same type and equality.

The while loop executes

zero to many times

the do loop executes

one to many
times.

The for loop executes

zero to many times and has a counter variable.

Use the break keyword to

exit from the current loop

Use the try, catch, and finally keywords

to handle exceptions.

_________can be used to perform TDD with web applications.



________can be used to perform TDD with Windows 8 applications.



__________is an open-source package management system for the .NET platform that
simplifies the addition of third-party libraries into your code.

QUnit can be used to perform TDD with web applications.


QUnit-Metro can be used to perform TDD with Windows 8 applications.


NuGet is an open-source package management system for the .NET platform that
simplifies the addition of third-party libraries into your code.

When creating tests, always create a

failing test first, and then add code to make the
test pass.

Always try to keep your JavaScript code

separate from your HTML

For best performance, place the

bottom of the HTML docu-
ment, before the

set a breakpoint in your JavaScript by clicking the statement and pressing

F9
(Debug | Toggle Breakpoint).

You can step through code by pressing

F11 (Debug | Step Into), F10 (Debug | Step
Over), or Shift+F11 (Debug | Step Out).

An array is a

collection object that has a sequence of items that you can access and
modify

Use the length property on
the array to

retrieve the size of the array.

A function that is defined on an object is called

a method

Events are based on the

publisher or subscriber pattern

To subscribe to an event, you can use the

addEventListener function.

To cancel event
propagation, use the

stopPropagation function on the Event object

To unsubscribe
from an event,

use the removeEventListener function.

To stop default behavior, call the

preventDefault method on the Event object

To add an event subscription on an HTML element, add the

“on” prefix to the event
name to get the name of the attribute you will add to the start tag of the element.