Sie sind auf Seite 1von 172

QUESTION 1

71You are developing an HTML5 web application and are styling text. You need to us
e the text
transform CSS property. Which value is valid for the texttransform property?
A.
B.
C.
D.

Lowercase
Blink
Linethrough
20px

Correct Answer: A

QUESTION 2
72DRAG DROP You are developing a web page for runners who register for a race. The
page
includes a slider control that allows users to enter their age. You have the follow
ing requirements:
All runners must enter their age.
Applications must not be accepted from runners less than 18 years of age or great
er than
90 years.
The slider control must be set to the average age (37) of all registered runners
when the
page is first displayed.
You need to ensure that the slider control meets the requirements.
What should you do? (To answer, drag the appropriate word or number to the correct
location in
the answer area.
Each word or number may be used once, more than once, or not at all. You may need t
o drag the
split bar between panes or scroll to view content.)
Select and Place:

Correct Answer:
QUESTION 3
73You are creating a JavaScript object that represents an employee. You need to ex
tend the
Employee object by adding the GetPayroll() method. You need to

A.

B.
C.

D.

Correct Answer: D

QUESTION 4
74You are developing an HTML5 page that includes several paragraph elements. You h
ave the
following requirements:

Add a drop shadow that is one inch below the text in the paragraph
Set the radius of the drop shadow to five pixels
You need to style the paragraphs to meet the requirements. Which CSS style should y
ou use?
A.
B.
C.
D.

Textshadow: 72pt 0pt 5pt


Textshadow: 5px lin 0px;
Textshadow: 72pt 0em 5px;
Textshadow: 100px 0px 5px;

Correct Answer: B
Explanation/Reference:
It seems like none of the above is correct! The correct answer should be: text
shadow: 0 72pt 5px;
reference: http://reference.sitepoint.com/css/textshadow
QUESTION 5
75You are developing an HTML5 web application and are styling text. You need to us
e the text
transform CSS property. Which value is valid for the texttransform property?
A.
B.
C.
D.

Capitalize
Red
20px
Italic

Correct Answer: A

QUESTION 6
76You are modifying a blog site to improve search engine readability. You need to
group relevant
page content together to maximize search engine readability. Which tag should you u
se?
A.
B.
C.
D.

<article>
<table>
<div>
<span>

Correct Answer: A

QUESTION 7
77You are developing an HTML5 page that has an element with an ID of picture. The
page
includes the following HTML.
You need to move the picture element lower on the page by five pixels. Which two li
nes of code
should you use? (Each correct answer presents part of the solution. Choose two.)
A.
B.
C.
D.

document.getEIementById(picture).style.position = relative;
document.getElementById(picture).style.top = 5px;
document.getEiementById(picture).style.top = 5px;
document.getEIementById(picture).style.position = absolute;

Correct Answer: AB

QUESTION 8
78You are modifying a blog site to improve search engine readability. You need to
group relevant
page content together to maximize search engine readability. Which tag should you u
se?
A.
B.
C.
D.

<section>
<tbody>
<div>
<table>

Correct Answer: A

QUESTION 9
79You are developing a customer web form that includes the following HTML. <input
id=txtValue/>
You need to change the HTML markup so that customers can enter only a valid three
letter
country code. Which HTML should you use?
A.
B.
C.
D.

<input id=txtValue type=country/>


<input id=txtValue type=text required=xxx/>
<input id=txtVa!ue type=text pattern [AZaz] {3} />
<input id=txtValuen type=code pattern=country/>

Correct Answer: C

QUESTION 10
80You are developing an HTML5 web application and are styling text. You need to us
e the text
transform CSS property. Which value is valid for the texttransform property?
A.
B.
C.
D.
Capitalize
Hidden
Italic
Linethrough

Correct Answer: A
QUESTION 11
81You are developing an HTML5 web application and are styling text. You need to us
e the text
transform CSS property. Which value is valid for the texttransform property?
A.
B.
C.
D.

Italic
Linethrough
Capitalize
20px

Correct Answer: C

QUESTION 12
82You are modifying a blog site to improve search engine readability.You need to g
roup relevant
page content together to maximize search engine readability. Which tag should you u
se?
A.
B.
C.
D.

<tbody>
<article>
<div>
<span>

Correct Answer: B

QUESTION 13
83You are modifying a blog site to improve search engine readability. You need to
group relevant
page content together to maximize search engine readability.Which tag should you us
e?
A.
B.
C.
D.

<span>
<nav>
<cable>
<section>

Correct Answer: D

QUESTION 14
84You are developing an HTML5 web application and are styling text. You need to us
e the text
transform CSS property. Which value is valid for the texttransform property?
A.
B.
C.
D.
red
hidden
lowercase
italic

Correct Answer: C
QUESTION 16
86DRAG DROP You are creating an application by using HTML5 and CSS3. The styles fo
r the pages
are derived from five style sheets.
The styles are not being applied correctly to the pages in the application.
You need to determine the order in which the style sheets will be applied by the br
owser.
In which order will the five style sheets be applied? (To answer, move the style sh
eet types from
the list of style sheet types to the answer area and arrange them
in the order that they will be applied.)
Select and Place:

Correct Answer:

Explanation/Reference:

The order of declarations from least important to most important:

QUESTION 18
88You develop an HTML5 webpage. You have the following HTML markup: (Line numbers
are for
reference only.)
The webpage also contains the following CSS markup:

You need to determine how the webpage will appear when the CSS styles are applied.
Select two.
A.
B.
C.
D.
E.

The first row of the table will have a red background.


The second row of the table will have a red background.
The second cell in the first row of the table will have a blue background.
The second cell in the third row of the table will have a blue background.
The second cell in the third row of the table will have not have blue background.

Correct Answer: AE

QUESTION 19
89HOTSPOT You are reviewing the CSS markup for an HTML5 page that displays a news
article.
The CSS markup for the page is as follows:
The HTML markup for the page is as follows:

For each statement in the table, select Yes if the code segments above causes the p
age to behave
as described. Select No if it does not. Make only one selection in each column.

Hot Area:
Correct Answer:

QUESTION 20
90HOTSPOT You review code that uses WebSockets for a browserbased multiplayer gam
e. Each
player sends a move to the server, which then sends the move to all connected game
instances.
The following code runs in the browser and handles the sending and receiving of mov
es:
For each statement in the table, select Yes if the code segment above causes the pa
ge to behave
as described. Select No if it does not. Make only one selection in each column.
Hot Area:

Correct Answer:

QUESTION 21
91You develop a webpage. The webpage must display a grid that contains one row and
five
columns. Columns one, three, and five are the same width. Columns two and four are
the same
width, but much wider than columns one, three, and five. The grid resembles the fol
lowing image:

The grid must meet the following requirements: Each row must be tall enough to ensu
re that
images are not cut off. Each row must contain five columns. The width of the column
s must not
change when the screen is resized or rotated. You need to define the style for the
grid. Which
CSS3 style should you use?

A.

B.

C.

D.

Correct Answer: C

QUESTION 22
92You implement an application by using HTML5 and JavaScript. You create a webpage
that
contains the following HTML:
The application must place a border on only the first UL element that is contained
in the DIV
element. You need to update the webpage. What should you do?

A.

B.

C.

D.

Correct Answer: C
QUESTION 23
93You troubleshoot a webpage that contains the following HTML element: <canvas id=
clickCanvas width300> height= 300>
Your browser does not support the HTML5 canvas.</canvas>
The following JavaScript code is included in a script tag in the HEAD section of th
e webpage: (Line
numbers are included for reference only.)

You need to invoke the clickReporter() JavaScript function when a user clicks the m
ouse on the
canvas HTML element. What should you do?

A. Add the following attribute to the canvas HTML element: clicked= clickReporter(
)
B. Replace the code segment at line 06 with the following code segment: drawBox.Cli
ck +=
clickReporter;
C. Insert the following code segment at line 07: canvas.onclick = clickReporter;
D. Insert the following code segment at line 07: canvas, click = clickReporter;

Correct Answer: C

QUESTION 24
94You are implementing an application by using HTML5 and JavaScript. A web page co
ntains the
following HTML table.
The application must:

Identify all rows in the table body that have a class attribute of selected
Exclude the last selected row in the table
You need to implement the web page according to the requirements. Which CSS selecto
r should
you use?

A. tr:not(tr:lastchild).selected < #dataTable


B. #dataTable > tr.selected:not(tr:lastchild)
C. #dataTable tbody tr.selected:not(tr:lastchild)
D. #dataTable tr.selected:not(tr:lastchild)
Correct Answer: C

QUESTION 25
95You create an application that sends information to a web service by using the f
ollowing code:
(Line numbers are included for reference only.)

When the web service returns a nonzero result code, you must raise an exception th
at contains
the result code. You need to implement the code that generates the exception. Which
line of
code should you insert at line 04?
A. CustomError .prototype = Error.prototype;
B. CustomError [ErrorType] = Error;
C. CustomError.customError = true;
D. Errorconstructor = CustomError;
Correct Answer: A

QUESTION 26
96You are developing a customer web form that includes following HTML. <input id=
textAccountType/>
You need to develop the form so that customers can enter only a valid account type
consisting of
two English alphabet characters. Which code segment should you use?

A.

B.

C.

D.

Correct Answer: B

QUESTION 27
97You are developing an application that uses a JavaScript library. The library co
ntains the
following functions.
The application uses the following code. (Line numbers are included for reference o
nly.)

The library may throw many types of exceptions. The exceptions are grouped by categ
ory.
You need to catch and identify the exceptions by group.
Which code segment should you insert at line 05?

A.

B.
C.

D.

Correct Answer: B

QUESTION 28
98DRAG DROP You develop an HTML5 webpage. You have the following HTML markup:

You also have the following JavaScript variable defined: var languages = [];
You need to add statements to an existing JavaScript function to sort the list item
s. Which four
actions should you perform in sequence? (Develop the solution by selecting the requ
ired code
segments and arranging them in the correct order.)
Select and Place:
Correct Answer:

QUESTION 29
99DRAG DROP You create an HTML5 webpage. You have the following HTML markup:
You also have the following JavaScript code segment: var jsonFruit = { apples :
12, bananas :
8, watermelon : 3 }
You need to add additional rows to the fruitTable element by processing the jsonFru
it values in
the order listed. Which three actions should you perform in sequence?
(Develop the solution by selecting the required code segments and arranging them in
the correct
order.)
Select and Place:

Correct Answer:
QUESTION 30
100DRAG DROP You have the following code:

The web service returns a JSON object that contains two properties named Descriptio
n and
FileName. The PersonImage object must meet the following requirements:
Create an object that represents an image that will be displayed.
Set the image properties from the values that are returned by the web service.
.Expose the image as a property of the PersonImage object.
You need to insert code at line 13 to complete the implementation of the PersonImag
e object.
Which three actions should you perform in sequence to complete the implementation?
(Develop the solution by selecting the required code segments and arranging them in
the correct
order.)
Select and Place:

Correct Answer:
QUESTION 31
101HOTSPOT You develop an HTML messaging application that allows users to send mes
sages.
The messages can have an optional file attachment that is identified by a filename.
You use the
following function to send a message:

You need to send a message with a file attachment. How should you complete the rele
vant code?
(To answer, select the appropriate option from each dropdown list in the answer ar
ea.)

Correct Answer:
QUESTION 32
102DRAG DROP You develop an HTML application that calls a web service to retrieve
JSON data.
The web service contains one method named GetFullName that returns an Object named
data.
The data object contains two properties named GivenName and Surname. You need to lo
ad data
from the web service to the webpage. How should you complete the relevant code? (To
answer,
drag the appropriate code segment or code segments to the correct location or locat
ions in the
answer area. Use only code segments that apply.)
Select and Place:

Correct Answer:

QUESTION 33
103DRAG DROP A company asks you to create a function that displays loan amounts to
their
customers. You must create the function by using JavaScript to meet the following r
equirements:
Display three different loan amounts to each customer.
Display loan amounts in order starting with the greatest amount and ending with t
he least
amount.
You need to implement the function. How should you complete the relevant code? (To
answer,
drag the appropriate command or commands to the correct location or locations in th
e answer
area. Use only commands that apply.)
Select and Place:

Correct Answer:

QUESTION 34
104HOTSPOT You develop an HTML5 application that allows images to be dragged and d
ropped
within a webpage. The webpage contains a DIV element and four IMG elements as defin
ed in the
code segment below:

You need to enable drag and drop for the application. How should you complete the r
elevant
code? (To answer, select the appropriate option from each dropdown list in the ans
wer area.)
Hot Area:

Correct Answer:
QUESTION 35
105DRAG DROP You are creating a function named getText().
The function must retrieve information from text files that are stored on a web ser
ver. You need
to develop the function to meet the requirement. Which code segment or segments sho
uld you
use? (To answer, drag the appropriate command from the list of commands to the corr
ect
location or locations in the work area.
Each code segment may be used once, more than once, or not at all. You may need to
drag the
split bar between panes or scroll to view content.)
Select and Place:

Correct Answer:
QUESTION 36
106DRAG DROP
You are developing an application for a retail store. The application will be used
on mobile devices
to provide realtime directions to the store.
You have the following requirements:
The application must find out a users location.
As the user moves, the application must update the screen with the new location.
As the user moves, the application must display the users speed. You need to dev
elop the
application to meet the requirements. Which code segment or segments should you use
?
(To answer, drag the appropriate code segment or segments to the correct location i
n the
work area. Each code segment may be used once, more than once, or not at all. You m
ay
need to drag the split bar between panes or scroll to view content.)

Select and Place:

Correct Answer:
QUESTION 37
107HOTSPOT You develop a webpage. You create the following HTML markup:

The layout of the webpage must contain three rows.


The first row spans the entire width of the page and is labeled #Top.
The second row contains three columns.
The first column is labeled #Left; the second column is labeled #Main; and the righ
t column is
labeled #Right.
The #Left and #Right columns are a fixed width.
The #Main column occupies the remaining available space.
The third and final row spans the entire width of the page and is labeled #Bottom.
The layout of the webpage must resemble the following image:

You need to create the CSS styles to implement the layout. How should you complete
the relevant
styles? (To answer, select the appropriate option from each dropdown list in the a
nswer area.)
Correct Answer:

QUESTION 38
108DRAG DROP You develop an HTML application that calls a Simple Object Access Pro
tocol
(SOAP) web service to retrieve data. You need to load data from the web service. Wh
at should
you do? (To answer, drag the appropriate code segment or code segments to the corre
ct location
or locations in the answer area. Use only code segments that apply.)
Select and Place:
Correct Answer:

QUESTION 39
109HOTSPOT You are creating a custom style by using CSS3. You have the following
requirements to complete the style:
If the text in a line must wrap to another line, the last word must be able to br
eak across
lines.
All text must be black and have a blue shadow, such that the text appears to glow
blue.
The text must look like the following:

You need to complete the CSS3 style. How should you complete the relevant code? (To
answer,
select the appropriate option from each dropdown list in the answer area.)
Hot Area:
Correct Answer:

QUESTION 40
110HOTSPOT You are developing a web page. The webpage must display a container. Th
e
container must display three colored rectangles near the top of the container. The
colored
rectangles are, in order, green, red, and yellow. The rectangles are aligned horizo
ntally and evenly
spaced across the width of the container. The layout of the page must resemble the
following
image:

You need to ensure that the page renders properly. How should you complete the rele
vant styles?
(To answer, select the appropriate option from each dropdown list in the answer ar
ea.)
Correct Answer:

QUESTION 41
111DRAG DROP You create the following JavaScript code:

You must complete the ShowCanWeAfford() function:

Display the message Denied! If the PaymentAmount variable is greater than 500.
Display the message Approved! If the PaymentAmount variable is less than 300.
Display the message Approved with caution! If the PaymentAmount variable is less
than
500 and greater than 300.
You need to add statements to the ShowCanWeAfford() JavaScript function to meet the
requirements.
Which three actions should you perform in sequence? (Develop the solution by select
ing the
required code segments and arranging them in the correct order.)
Select and Place:
QUESTION 42
112DRAG DROP You have a webpage that includes the following markup:

An XML file named message.xml resides on a web server. The structure of the file is
as follows:

You are developing a codebased solution to parse the contents of the XML file and
display the
information on the page. The solution must work on both modern and older browsers.
You need to display the information from the XML file onto the page. How should you
create the
JavaScript code? (Develop the solution by selecting the required code segments and
arranging
them in the correct order. You may not need all of the code segments.)
Select and Place:

Correct Answer:
QUESTION 43
113HOTSPOT You review a web form that contains the following markup and code:

You
need to ascertain how the webpage responds when it loads and how it reacts to user
actions.
For each statement in the table, select Yes if the code segment above causes the pa
ge to behave
as described. Select No if it does not. Make only one selection in each column.
Hot Area:

Correct Answer:

QUESTION 44
114HOTSPOT You test a webpage that contains the following JavaScript code:

The webpage also contains the following markup:

You
need to ascertain how the webpage responds when the user enters characters and then
clicks the
add and divide buttons.
For each statement in the table, select Yes if the action causes the webpage to beh
ave as
described. Select No if it does not. Make only one selection in each column.
Hot Area:
Correct Answer:

QUESTION 45
115An HTML page contains no embedded JavaScript or CSS code. The body of the page
contains
only the following line of code. <p id=test>test</p> A CSS style sheet must be ap
plied
dynamically. The style must visibly change the appearance of the paragraph on the p
age.
You need to apply a style the paragraph. Which line of code should you use?
A.
B.
C.
D.

document.getElementById(test).style.border = 0;
document.getElementById(test).style.position = static;
document.getElementById (test).style.padding = 15px;
document.getElementById(test).style.top = 5px;

Correct Answer: C

QUESTION 46
116You develop an HTML5 web application. The web application contains a form that
allows
users to enter only their month of birth. The value that the users enter must be nu
mbers between
1 and 12, inclusive.
You need to implement the form element for the month of birth. Which element should
you use?
A.
B.
C.
D.

<input type=time options=month />


<input types=submit value=month />
<input type=range min=l max=12 />
<input type=month itemscope=numeric />

Correct Answer: C
QUESTION 47
117You are developing an HTML5 web application for an architectural company that d
isplays
architectural blueprints. The application must:
Display the blueprints at different zoom levels without loss of detail
Print the blueprints without loss of detail
Work from only one source file per blueprint
You need to ensure that blueprints display according to the requirements.
Which HTML5 element should you use?
A.
B.
C.
D.

CANVAS
SAMP
SVG
AREA

Correct Answer: C

QUESTION 48
118You develop an HTML5 application that allows users to upload files from their l
ocal
computers.
The user interface must remain responsive during the upload.You need to implement t
he file
upload functionality for the application.Which two actions should you perform? (Eac
h correct
answer presents a complete solution. Choose two.)
A.
B.
C.
D.

Use an HTML form with a file type INPUT element that targets a hidden IFRAME elemen
t.
Use a file type INPUT element, and then use the Web Storage API to upload the file.
Use a FormData object and upload the file by using XMLHttpRequest.
Register the file protocol by using protocol handler registration API and then uplo
ad the file
by using XMLHttpRequest.
E.
Use the FileSystem API to load the file, and then use the jQuery post method to upl
oad the
file to the server.
Correct Answer: BD

QUESTION 49
119You are developing a web application that can function when users are not conne
cted to the
Internet.
You need to check the Internet connectivity status of a users browser.
Which method should you use?

A.
B.

C.

D.

Correct Answer: A

QUESTION 50
120You are creating a page that contains detailed employee information for a compa
ny portal.
The page uses a jQuery library.
The page contains a hidden button named btnEdit that is defined by the following co
de. <button
id=btnEdit style=display: none;n>Edit</button>
The button is not displayed by default. The button must be displayed only if the us
er is logged on.
You need to add code to the document.ready() function to meet the requirements for
the button.
Which line of code should you use?
A.
B.
C.
D.

$ (#btnEdit).appear ();
$ (#btnEdit).visible = true;
$ (#btnEdit).show();
$ (#btnEdit).Visible();

Correct Answer: B
QUESTION 51
121HOTSPOT You troubleshoot a webpage that includes the following code segment:

You need to evaluate the value of the variable named customer.name. For each statem
ent in the
table, select Yes if the code segment above causes the variable to evaluate as desc
ribed. Select No
if it does not. Make only one selection in each column.
Hot Area:

Correct Answer:

QUESTION 52
122HOTSPOT You develop an HTML5 webpage that contains the following markup and cod
e:
You have the following requirements:

Display a message if users select the first OPTION element, and then submit the f
orm.
Do not display an alert message if users select any other OPTION element, and the
n submit
the form.
You need to implement the madeSelection() function.
How should you complete the relevant code? (To answer, select the appropriate code
segment
from each dropdown list in the answer area.)
Hot Area:

Hot Area:

Correct Answer:
QUESTION 53
123HOTSPOT
You develop a webpage that consumes a web service. The web service provides currenc
y
exchange rates. Visitors enter the currency type on the webpage and press the Submi
t button.
The web service returns the current exchange rate. You need to ensure that the webp
age always
displays the most current information. How should you complete the relevant code? (
To answer,
select the appropriate option from each dropdown list in the answer area.)
Hot Area:

Hot Area:
Correct Answer:

QUESTION 54
124HOTSPOT You develop a webpage. The layout of the webpage must resemble the foll
owing
image:
You need to ensure that the page renders properly. How should you complete the rele
vant CSS
styles? (To answer, select the appropriate option from each dropdown list in the a
nswer area.)

Hot Area:
Correct Answer:

QUESTION 55
125HOTSPOT
A company has an XML file named products.xml on a web server. The file contains a l
ist of the
products that the company sells. You need to display the contents of the products.x
ml file in a DIV
element named Output. How should you complete the relevant code? (To answer, select
the
appropriate option from each dropdown list in the answer area.)
Hot Area:

Correct Answer:

QUESTION 56
126You are developing an application that analyzes population data for major citie
s in the United
States.
The application retrieves population statistics for a city by using a web service.
You need to request data from the web service by using jQuery.
Which code segment should you use?

A.

B.

C.

D.

Correct Answer: D

QUESTION 57
127You are developing a blog web page that is being optimized for accessibility. T
he page
includes the following HTML.

The heading tags represent a blog post title, a blog post subtitle, and the author
s name. You need
to ensure that the three headings are treated as a unit but retain their individual
formatting.
Which tags should you use to wrap the H1, H2, and H3 elements?
A.
B.
C.
D.

<group> </group>
<header> </header>
<hgroup> </hgroup>
<headings> </headings>

Correct Answer: C

QUESTION 58
128You develop a web application by using jQuery. You develop the following jQuery
code: (Line
numbers are included for reference only.)
The web application exposes a RESTful web API that has an endpoint of/product/creat
e.
You need to create a new product by using AJAX.
Which code segment should you insert at line 05?

A.

B.

C.

D.

Correct Answer: D

QUESTION 59
129You develop a webpage that allows a user to download a 3PEG image and convert i
t to a PNG
file. You need to implement the code to download the contents of the JPEG image wit
h no
additional decoding. Which JavaScript function should you use?
A.
B.
C.
D.

readAsBinaryString()
readAsArrayBuffer()
readAsDataURL()
readAsText()

Correct Answer: B
QUESTION 60
130You are modifying a blog site to improve search engine readability.
You need to group relevant page content together to maximize search engine readabil
ity.
Which tag should you use?
A.
B.
C.
D.

<article>
<span>
<tbody>
<cd>

Correct Answer: A

QUESTION 61
131DRAG DROP You are developing a shared library to format information.
The library contains a method named _private. The _private method must never be cal
led directly
from outside of the shared library.
You need to implement an API for the shared library.
How should you complete the relevant code? (Develop the solution by selecting the r
equired
code segments and arranging them in the correct order.
You may not need all of the code segments.)
Select and Place:
Correct Answer:
QUESTION 62
132You develop an HTML application that contains a table that displays a list of p
roducts. The
table is defined with the following HTML markup:

You must style the table to look like the following image:
You need to implement the CSS selectors to select the rows that must have a blue ba
ckground.
Which CSS selector should you use?
A.
B.
C.
D.

thead:onlychild, tbody:after, table:before


tr [line |0, 1, 3]
tr:firstoftype, tr:lastoftype
tr:firstline, tr:lastchild

Correct Answer: C

QUESTION 63
133You develop a webpage by using HTML5. You create the following markup:
<input type url name= website required=required />
You need to ensure that the value that the user enters contains a secure URL.
What should you do?
A.
B.
C.
D.

Add the following attribute to the input tag: value=https://v


Add the following attribute to the input tag: pattern=https://.+
Add the following attribute to the input tag: value=ssl
Add the following attribute to the input tag: itemtype=https

Correct Answer: B

QUESTION 64
134You develop a webpage by using HTML5. You create the following markup and code:
(Line
numbers are included for reference only.)

You need to ensure that the values that users enter are only numbers, letters, and
underscores,
regardless of the order. Which code segment should you insert at line 04?
A.

B.

C.

D.

Correct Answer: A

QUESTION 65
135HOTSPOT You develop an interactive scalable vector graphics (SVG) application.
You write the
following HTML markup that makes a rectangle rotate:

You need to control the speed of the rotating rectangle.


How should you complete the relevant code? (To answer, select the appropriate optio
n from
each dropdown list in the answer area.)
Hot Area:
Correct Answer:
QUESTION 66
136DRAG DROP You create a webpage that includes the following HTML markup: (Line n
umbers
are included for reference only.)

You need to ensure that a form cannot be submitted unless the INPUT element contain
s the word
OK. Which five actions should you perform in sequence? (To answer, move the appropr
iate
actions from the list of actions to the answer area and arrange them in the correct
order.)
Select and Place:

Correct Answer:
QUESTION 67
137DRAG DROP You are implementing a web worker by using JavaScript and HTML5. The
web
worker processes a longrunning loop and returns the result to a webpage. The web w
orker is
defined on the webpage as follows:

You have the following requirements:

Evaluate the message value in the web worker.


Process the loop based on the iterations value that is passed from the webpage.
Return a value back to the webpage from the web worker.
You need to implement the web worker. How should you complete the relevant code?
(To answer, drag the appropriate code segment to the correct location or locations
in the answer
area. Use only code segments that apply.)
Select and Place:

Correct Answer:
QUESTION 68
138HOTSPOT

How does the page render? For each statement in the table, select Yes if the behavi
or is
described. Select No if it is not. Make only one selection in each column.
Hot Area:

Correct Answer:
QUESTION 69
139You are creating an HTML5 application that allows users to play video on a page
by using the
VIDEO element.
You need to enable the user to start, stop, and pause the video.
Which line of code should you add to the page?
A. <video id= myVideo height=320 width=400 src=myVideo.vtt
contextmenu=pauseplay> </video>
B.
<video id=myVideon heigh=320 width=400 src=myVideo.vtt controls> </video>
C.
<video _d=myVideon height=320 width=400 src=myVideo.vtt autoplay> </video>
D. <video id=myVideo height=320 width=400 src=myVideo.vtt
contextinenu=Startstopn> </video>
Correct Answer: B

QUESTION 70
140You are creating a web page that contains a canvas with text.
The page contains the following JavaScript code. (Line numbers are included for ref
erence only.)

The text on the canvas must rotate 90 degrees when a user clicks a button on the pa
ge.
You need to ensure that the text rotates when the user clicks the button.
Which line of code should you add at line 03?
A.
B.
C.
D.

context.transform(90);
context.content.getRotation(90);
context.rotate(90);
context.content.rotate (90);

Correct Answer: C

QUESTION 71
141You develop an HTML5 webpage that contains the following HTML markup:

You have the following requirements:


Retrieve the content for any OPTION elements when the value of the selected attri
bute
equals selected.
Add the content to a comma separated string.
You need to retrieve the required data.
Which two code segments should you add to the webpage? (Each correct answer present
s a
complete solution. Choose two.)

A.

B.

C.

D.

E.

Correct Answer: BD

QUESTION 72
142DRAG DROP You are creating a function by using JavaScript. You have the followi
ng
requirements:
The function must display loan amounts to the user within the following HTML elemen
t: <div
id=display></div>
The loan amount of 2100 must display in the HTML element. All declared variables an
d functions
must be scoped to the myApp variable.
You need to implement the function. How should you complete the relevant code?
(To answer, drag the appropriate code segments to the correct location or locations
in the answer
area. Use only code segments that apply.)
Select and Place:
Correct Answer:

QUESTION 73
143HOTSPOT You create a custom style by using CSS3. A box with rounded corners mus
t appear
around text. The box must match the following illustration:
You need to add the CSS3 markup to your style. How should you complete the relevant
CSS
styles? (To answer, select the appropriate option from each dropdown list in the a
nswer area.)

Hot Area:

Correct Answer:

QUESTION 74
144HOTSPOT
You implement a callback function by using JavaScript. You need to process the retu
rned XML
data. How should you complete the relevant code? (To answer,select the appropriate
option from
each dropdown list in the answer area.)
Hot Area:

Correct Answer:
QUESTION 75
145You develop an HTML5 application. You give users a numeric access code that can
be used
only one time.
Users must enter the numeric access code in the login form of the application.
The numeric characters must be hidden by a masking character.
You need to implement the form element for users to enter the code.
Which HTML element should you use?
A.
B.
C.
D.

<input type=password required autocomplete=off>


<input type=input autocomplete=off required />
<input type=password stytem visiblity:hidden; required />
<input type=button value=password required />

Correct Answer: A

QUESTION 76
146You are developing an HTML5 web application that displays stock information. Th
e
application loads information from a web service by using AJAX.
The following code defines a Stock object and loads stock data.

You need to implement the loadStock function. Which code segment should you use?

A.
B.
C.

D.

Correct Answer: A

QUESTION 77
147HOTSPOT You review a webpage that contains the following markup:

How does the page render? For each statement in the table, select Yes if the behavi
or is
described. Select No if it is not. Make only one selection in each column.
Hot Area:

Correct Answer:
QUESTION 78
148DRAG DROP You create an HTML5 application that includes JavaScript. The applica
tion
performs several AJAX requests.One AJAX request retrieves order information from a
web service
and then sends the information back to a webpage within the application. You must c
reate a
custom event.
You have the following requirements:
The webpage must contain an HTML element named ordersListing that will receive th
e
custom event notification.
The event name must be ordersReceived.
The event must pass a custom value named orderCount.
The event must run a JavaScript method named showOrdersReceivedCount after the or
ders
Listing HTML element receives the event.
Do not allow other DOM elements to receive the event.
Allow the event to be cancelled.
Send the event into the event system.
You need to implement the custom event to notify specific DOM elements of the AJAX
response.
Which three actions should you perform in sequence? (Develop the solution by select
ing the
required code segments and arranging them in the correct order.)
Select and Place:
Correct Answer:
QUESTION 79
149DRAG DROP You are developing an application by using JavaScript.
You must write a function that returns the sum of the variables named v1, v2, v3, v
4.
You need to complete the sum function. How should you complete the relevant code? (
To
answer, drag the appropriate code segment or segments to the correct location or lo
cations in
the answer area. Use only code segments that apply.)
Select and Place:
Correct Answer:

QUESTION 80
150You are developing a web page that includes the following HTML. <span id = myT
extSpan
class = redText> Hello There! </span>
The font color of text inside the span must be red. You need to develop the web pag
e to meet the
requirement. Which two CSS segments will achieve the goal? (Each correct answer pre
sents a
complete solution. Choose two.)

A.

B.
C.

D.

Correct Answer: AC

QUESTION 81
151You are troubleshooting an application. Users report that the UI is slow to res
pond.
You need to improve UI responsiveness by moving application tasks to web workers.
Which two tasks can you move to achieve this goal? (Each correct answer presents a
complete
solution. Choose two.)
A.
A function that loops through the Document Object Model to update the style of page
elements
B. A longrunning calculation that requires looping through an array
C. A function that performs graphicintensive animation
D. A function that stores large amounts of data to local storage
Correct Answer: BC

QUESTION 82
152You develop an interactive scalable vector graphic (SVG) application.
You write the following code (Line numbers are included for reference only.):

You need to increase the size of the circle by 50 percent. Which code segment shoul
d you insert
at line 02?

A.
B.

C.

D.

Correct Answer: B

QUESTION 83
153You develop an HTML5 webpage. You have the following HTML markup:

You need to change the background color for all of the elements whose name attribut
e ends with
the word name. Which code segment should you add to the webpage?
A.
B.
C.
D.

$ (#name).css ({ backgroundcolor : #E0ECF8 });


$ (input [name |=name; ] ) .css (( backgroundcolor : #E0ECF8});
$(input[name$=name]). css{{backgroundcolor : #E0ECF8});
$ (*name ) .css ({ backgroundcolor : #E0ECF8}) ;

Correct Answer: C

QUESTION 84
154You develop an HTML application that is located at www.adventureworks.com. The
application must load JSON data from www.fabrikam.com. You need to choose an approa
ch for
loading the data. What should you do?
A.
B.
C.
D.

Design a REST URI scheme with multiple domains.


Configure CrossOrigin Resource Sharing (CORS) on the servers.
Load the data by using WebSockets.
Use the jQuery getJSON method.

Correct Answer: B
QUESTION 85
155You are building a web page for a newspaper publisher. You have the following r
equirements:
The web page should split the content into columns that are at least 100 pixels w
ide.
The number of columns displayed must be set by the browser.
You need to implement the correct CSS properties.
Which line of code should you use?
A.
B.
C.
D.

<div id=outer style=width: 100px; columnfill: balance;></div>


<div id=outer style=width: 100px; columngap: 10px;></div>
<div id=outer style=columnwidth: 100px; >. . .</div>
<div id=outer style=width: 100px; columns: 100px 3></div>

Correct Answer: C

QUESTION 86
156You develop a webpage with a standard input control by using HTML5. The input c
ontrol
must display the text Enter your given name, as shown below:

When a user selects the input control, the text must disappear. You need to create
the input
control. Which input control should you use?
A.
B.
C.
D.

<input name=GivenName value= Enter your given name />


<input name =GivenName default= Enter your given name />
<input name=GivenName text= Enter your given name />
<input name=GivenName placeholder= Enter your given name />

Correct Answer: D

QUESTION 87
157You develop an HTML5 webpage. You have the following HTML markup:

You need to add a background color to the first article in each section. Which code
segment
should you add to the webpage?
A. $ (section article:firstchild).css(backgroundcolor, #f2f2f2);
B. $ (section:firstchild).ess ( backgroundcolor, #f2f2f2);
C. $ (article:firstoftype) .css(backgroundcolor, #f2f2f2);
D. $ (section:firstoftype).css(backgroundcolor, #f2f2f2);
Correct Answer: C

QUESTION 88
158You are creating a custom object as described by the following code.

You need to implement the calcArea method. Which code should you use?

A.

B.

C.

D.

Correct Answer: D

QUESTION 89
159DRAG DROP You are developing a web page that includes the following HTML.

You
need to ensure that the email element is enabled only if the user selects the IT Su
pport check box.
Which CSS selectors should you use? (To answer, drag the appropriate selector to th
e correct
location.
Each selector may be used once, more than once, or not at all.
You may need to drag the split bar between panes or scroll to view content.)
Select and Place:
Correct Answer:

QUESTION 90
160You are developing an HTML5 web form to collect feedback information from site
visitors.
The web form must display an INPUT element that meets the following requirements:
Allow numeric values between 1 and 10.
Default to the value of 5.
Display as a slider control on the page.
You need to add the INPUT element to the form. Which HTML element should you add?
A.
Rating (Between 1 and 10): <input type=number name=rating min =1 max10>
B. Rating (Between 1 and 10): <input type=number name=rating min=1 max=10
defaulc=5>
C. Rating (Between 1 and 10): <input type=range name=rating min=0 max=10
default=5>
D. Rating (Between 1 and 10): <input type=range name=rating min=10 max=10
value=5>
Correct Answer: D

QUESTION 91
161You develop an HTML5 application. The application uses an image that is returne
d from an
HTTP POST request.
You develop the following code: (Line numbers are included for reference only.)

You need to display the loaded image in the application. Which code segment should
you insert at
line 04?

A.

B.

C.
D.

Correct Answer: B

QUESTION 92
162You develop an HTML5 webpage that contains the following HTML markup: <input
id=loanTermTextBox type=text />
Users must enter a valid integer value into the text box. You need to validate the
data type that is
received from the input element.
Which two code segments should you include on the webpage?
(Each correct answer presents a complete solution. Choose two.)

A.

B.

C.
D.

E.

Correct Answer: AB

QUESTION 93
163You develop an HTML5 application for a company. Employees must enter a personal
identification number (PIN) in an INPUT element named SecurityCode to access their
employee
records.
The SecurityCode element must meet the following requirements:
Allow up to 6 digits.
Do not display numbers as they are entered.
Display the text Enter PIN Code before the user enters any data.
You need to implement the SecurityCode element.
Which HTML markup should you add to the application?

A.

B.
C.

D.

E.

Correct Answer: D

QUESTION 94
164DRAG DROP You develop an HTML5 webpage. You have the following HTML markup:

You need to update the content of the DIV element when the mouse hovers over an ima
ge and
when the mouse coordinates change.
How should you complete the relevant code? (To answer, drag the appropriate code se
gment to
the correct location or locations in the answer area.
Use only code segments that apply.)
Select and Place:

Correct Answer:
QUESTION 95
165HOTSPOT You are creating a custom CSS3 style. You have the following requiremen
ts to
complete the style:
box1 has a red outline.
box1 contains box2, and box2 must remain inside box1
box2 must have a green to black gradient.
box2 must be surrounded by white space.
The style resembles the following diagram:

You need to add the CSS3 code to the styles. How should you complete the relevant c
ode? (To
answer, select the appropriate code segment in each dropdown list in the answer ar
ea.)

Hot Area:
Correct Answer:

QUESTION 96
166You develop an application to host usergenerated HTML and JavaScript content.
A common
error handler in your application must process all unhandled errors. You need to im
plement
global error handling for the application. Which code segment should you use?

A.

B.
C.

D.

Correct Answer: A

QUESTION 97
167You are creating a custom function. You pass an object named testObj to the fun
ction as a
parameter. You do not use inheritance through the functions. The function must esta
blish
whether testObj inherits from another object named parentObj. You need to ensure th
at the
function performs as required. Which method or operator should you add to the funct
ion?
A.
B.
C.
D.

parentObj.instanceof(testObj)
testObj.isPrototypeOf(parentObj)
testObj.instanceof(parentObj)
parentObj.isPrototypeOf(testObj)

Correct Answer: B

QUESTION 98
168You develop an HTML5 webpage. You have the following HTML markup:

You
need to call the click event for the addOneltem button a determined number of times
when the
user clicks the addBoxOfltems button. Which code segment should you add to the webp
age?

A.

B.
C.

D.

Correct Answer: D

QUESTION 99
169HOTSPOT You are validating user input by using builtin JavaScript functions. T
he application
must:
Store the value that is entered in a variable named inputValue
Use the builtin isNaN(tnputValue) function to evaluate the data type
You need to validate the return value of the isNaN(inputValue) function.
Which values will be returned? (To answer, configure the appropriate options in the
dialog box in
the answer area.)

Hot Area:
Correct Answer:

QUESTION 100
1 DRAG DROP You are validating user input by using JavaScript and regular expressi
ons. A group
of predefined regular expressions will validate two input fields:
An email address in a function named validateEmail (for example, firstname@contos
o.com)
A ninedigit number that allows optional hyphens after the second and fifth chara
cter in a
function named validateSSN(for example, 555555555 or 555555555)
You need to use the correct expression to validate the input. Which expression shou
ld you insert
into each function?
(To answer, drag the appropriate regular expression statement to the correct locati
on. Each
regular expression statement may be used once, more than once, or not at all. You m
ay need to
drag the split bar between panes or scroll to view content.)
Select and Place:
Correct Answer:
QUESTION 101
2You are developing a customer web form that includes the following HTML. <input
id=txtValue type=text />
A customer must enter a valid age in the text box prior to submitting the form. You
need to add
validation to the control. Which code segment should you use?

A.
B.

C.

D.

Correct Answer: D

QUESTION 102
3You are developing a customer contact form that will be displayed on a page of a
companys
website.
The page collects information about the customer. If a customer enters a value befo
re submitting
the form, it must be a valid email address. You need to ensure that the data valida
tion
requirement is met. What should you use?
A.
B.
C.
D.

<input name=email type=url/>


<input name=email type=text required=required/>
<input name=email type=text/>
<input name=email type=email/>

Correct Answer: D

QUESTION 103
4DRAG DROP You are developing a form that captures a users email address by using
HTML5
and jQuery.
The form must capture the email address and return it as a query string parameter.
The query string parameter must display the @ symbol that is used in the email addr
ess.
You need to implement this functionality. How should you develop the form? (To answ
er, drag
the appropriate code segment to the correct target or targets in the
answer area. Each code segment may be used once, more than once, or not at all. You
may need
to drag the split bar between panes or scroll to view content.)
Select and Place:

Correct Answer:

QUESTION 104
5You are developing an application that consumes a Windows Communication Foundatio
n (WCF)
service. The application interacts with the service by using the following code. (L
ine numbers are
included for reference only.)
You need to authenticate to the WCF service. What should you do?

A. At line 11, add the following lines of code.


a. ,username: yourusername
b. ,password: yourpassword
B. At line 11, add the following line of code.
a. ,credentials: prompt
C. At line 06, replace the code with the following line of code.
a. url: http://contoso.com/Service.svc/GetCountry?
Username=username&password=psssword,
D. At line 11, add the following line of code.
a. The username and password will be stored in an XML file.
b. ,credentials: credentials.xml
Correct Answer: A

QUESTION 105
6You are developing a web page that enables customers to upload documents to a web
server.
The page includes an HTML5 PROGRESS element named progressBar that displays informa
tion
about the status of the upload.
The page includes the following code. (Line numbers are included for reference only
.)
An event handler must be attached to the request object to update the PROGRESS elem
ent on
the page.
You need to ensure that the status of the upload is displayed in the progress bar.
Which line of code should you insert at line 03?
A.
B.
C.
D.

xhr.upload.onloadeddata =
xhr.upload.onplaying =
xhr.upload.onseeking =
xhr.upload.onprogress =

Correct Answer: D

QUESTION 106
7You are developing a customer web form that includes the following HTML.
<label id=txtValueX/label>
Information from the web form is submitted to a web service.
The web service returns the following JSON object.
{
Confirmation: 1234,
FirstName: John
}
You need to display the Confirmation number from the JSON response in the txtValue
label field.
Which JavaScript code segment should you use?
A.
B.
C.
D.

$(#txtValue).val = (JSONObject.Confirmation);
$(#txtValue).val (JSONObject.Confirmation);
$(#txtValue).text = (JSONObject.Confirmation);
$(#txtValue).text (JSONObject.Confirmation);

Correct Answer: D

QUESTION 107
8HOTSPOT You are developing a web application that retrieves data from a web servi
ce. The data
being retrieved is a custom binary datatype named bint. The
data can also be represented in XML.
Two existing methods named parseXml() and parseBint() are defined on the page.
The application must:
Retrieve and parse data from the web service using binary format if possible.
Retrieve and parse the data from the web service using XML when binary format is no
t possible.
You need to develop the application to meet the requirements. What should you do? (
To answer,
select the appropriate options from the dropdown lists in the answer area.)

Hot Area:

Correct Answer:
QUESTION 108
9You are developing a customer web form that includes the following HTML. <input i
d =
txtValue />
A customer must enter a value in the text box prior to submitting the form.
You need to add validation to the text box control.
Which HTML should you use?
A.
B.
C.
D.

<input id=txtValue type=text required=required/>


<input id=txtValue type=text pattern=[AZaz]{3} />
<input id=txtValue type=required />
<input id=txtValue type=required autocomplete=on />

Correct Answer: A

QUESTION 109
10DRAG DROP You are developing a web page for runners who register for a race. The
page
includes a slider control that allows users to enter their age. You have the follow
ing requirements:
All runners must enter their age.
Applications must not be accepted from runners less than 18 years of age o
r greater
than 90 years.
The slider control must be set to the average age (37) of all registered r
unners when
the page is first displayed.
You need to ensure that the slider control meets the requirements. What should you
do? (To
answer, drag the appropriate word or number to the correct location in the answer a
rea.
Each word or number may be used once, more than once, or not at all.
You may need to drag the split bar between panes or scroll to view content.)
Select and Place:

Correct Answer:

QUESTION 110
11You are developing an HTML5 web application that displays the current temperatur
e
whenever a button is clicked. The following code provides this functionality.
When the temperature is loaded, the status property on the loader instance does not
change.
You need to ensure that the status property on the loader instance is updated when
the
temperature is loaded.
Which code segment should you use to replace the Loader function?

A.

B.

C.

D.

Correct Answer: A

QUESTION 111
12You are creating a class named Consultant that must inherit from the Employee cl
ass.
The Consultant class must modify the inherited PayEmployee method. The Employee cla
ss is
defined as follows.
function Employee() {}
Employee.prototype.PayEmployee = function ( ){
alerttHi there!);
} Future instances of Consultant must be created with the overridden method.
You need to write the code to implement the Consultant class.Which code segments sh
ould you
use? (Each correct answer presents part of the solution. Choose two.)
A. Consultant.PayEmployee = function () { alert(Pay Consulant); }
B. Consultant.prototype.PayEmployee = function () { alert(Pay Consultant); }
C.
function Consultant () { Employee.call(this); } Consultant.prototype = new Employee
();
Consultant.prototype.constructor = Consultant;
D.
function Consultant() { Employee.call(this); } Consultant.prototype.constructor =
Consultant.create;
Correct Answer: BC

QUESTION 112
13You are modifying an existing web page. The page is being optimized for accessib
ility. The
current page contains the following HTML.

Standardscompliant screen readers must be able to identify the links contained wit
hin the
navigation structure automatically.
You need to create the navigation link structure in the page.
With which container tags should you wrap the existing markup?
A.
B.
C.
D.

<navmap> </navmap>
<div id=nav> </div>
<nav> </nav>
<map> </map>

Correct Answer: C

QUESTION 113
14HOTSPOT You are developing an airline reservation website by using HTML5 and Jav
aScript. A
page on the site allows users to enter departure and destination airport informatio
n and search
for tickets. You have the following requirements:
Users must be able to save information in the application about their favo
rite
destination airport.
The airport information must be displayed in the destination text box when
ever the
user returns to the page.
You need to develop the site to meet the requirements.
Which lines of code should you use? (To answer, select the appropriate options from
the drop
down lists in the answer area.)

Hot Area:
Correct Answer:

QUESTION 114
15HOTSPOT

You are developing an HTML5 web application for displaying encyclopedia entries.
Each encyclopedia entry has an associated image that is referred to in the entry.
You need to display the image by using the correct semantic markup.
What should you do? (To answer, select the appropriate options from the dropdown l
ist in the
answer area.)

Hot Area:
Correct Answer:

QUESTION 115
16You are creating a JavaScript object that represents a customer.
You need to extend the Customer object by adding the GetCommission() method.
You need to ensure that all future instances of the Customer object implement the
GetCommission() method.
Which code segment should you use?
A.

B.

C.

D.

Correct Answer: D

QUESTION 116
17You are developing a web form that includes the following code.

When a user selects the check box, an input text box must be added to the page dyna
mically.
You need to ensure that the text box is added.
Which function should you use?

A.

B.

C.
D.

Correct Answer: B

QUESTION 117
18HOTSPOT An HTML page has a canvas element.
You need to draw a red rectangle on the canvas element dynamically.
The rectangle should resemble the following graphic.
How should you build the code segment? (To answer, select the appropriate options f
rom the
dropdown lists in the answer area.)

Hot Area:
Correct Answer:

QUESTION 118
19You are developing an HTML5 page that has an element with an ID of logo. The pag
e includes
the following HTML.
<div>
Logo:
<br> <div id=logo>
</div>
</div>
You need to move the logo element lower on the page by five pixels.
Which lines of code should you use? (Each correct answer presents part of the solut
ion. Choose
two.)
A.
B.
C.
D.

document.getElementById(logo) .style.position = relative;


document.getElementByld(logo).Style.top = 5px;
document.getElementById(logo).style.top = 5px;
document.getElementById(logo).style.position = absolute;

Correct Answer: AB

QUESTION 119
20You are developing a web page by using HTML5 and C5S3. The page includes a <div>
tag with
the ID set to validate.
When the page is rendered, the contents of the <div> tag appear on a line separate
from the
content above and below it.
The rendered page resembles the following graphic.

The page must be rendered so that the <div> tag is not forced to be separate from t
he other
content. The following graphic shows the correctly rendered output.

You need to ensure that the page is rendered to meet the requirement. Which line of
code should
you use?
A.
B.
C.
D.

document.getElementById(validate).style.display = inline;
document.getElementById(validate).style.margin = 0;
document.getElementById(validate).style.padding = 0;
document.getElementSyId(validate).style.display = block;

Correct Answer: A

QUESTION 120
21HOTSPOT You are creating a web worker for an HTML5 application. The following ta
sks must
be performed from within the web worker:
Register an event listener for the web worker
Start and stop the web worker You need to define a function that performs
the
required tasks.
Which code segment should you use? (To answer, select the appropriate option from t
he drop
down list in the answer area.)

Hot Area:

Correct Answer:
QUESTION 121
22You are creating a JavaScript function that displays the name of a web applicati
on.
You declare the following button element. <input type=button id= About value=A
bout />
When a user clicks the button, a JavaScript function named About must be called.
You need to create an event handler that calls the About function when the button i
s clicked.
Which two code segments can you use? (Each correct answer presents a complete solut
ion.
Choose two.)

A.
B.
C.

D.

Correct Answer: CD

QUESTION 122
23HOTSPOT You are creating a function by using JavaScript. The function accepts an
object as the
parameter and returns a string that identifies the data type of the object.
You have the following requirements:
The function must return Number if the object is a number.
The function must return String if the object is a string.
The function must return Unknown if the object is neither a number nor a
string.
You need to implement the function to meet the requirements.
How should you build the code segment? (To answer, select the appropriate options f
rom the
dropdown lists in the answer area.)

Hot Area:
Correct Answer:

QUESTION 123
24You need to test the value of the following variable in JavaScript. var length =
75;
A block of code must execute if the length equals 75 regardless of the data type.
You need to use the statement that meets this requirement.
Which lines of code should you use? (Each correct answer presents a complete soluti
on. Choose
two.)
A.
B.
C.
D.

if (length = = = 75)
if (length = = 75)
if (length ! = 75)
if (length = = 75)

Correct Answer: BD

QUESTION 124
25You are developing an application that uses a thirdparty JavaScript library nam
ed doWork().
The library occasionally throws an object is null or undefined error with an erro
r code of
2146823281. The application must:
Extract and handle the exceptions thrown by doWork()
Continue normal program execution if other exceptions occur
You need to implement the requirements.
Which code segment should you use?

A.

B.

C.

D.

Correct Answer: C

QUESTION 125
26You are troubleshooting a web page that includes the following code. (Line numbe
rs are
included for reference only.)
What is displayed in the alert from line 11?
A.
B.
C.
D.

Div
Function
Button
Document

Correct Answer: C

QUESTION 126
27You are developing a web application that consumes services from a thirdparty a
pplication.
A web worker processes the thirdparty application requests in the background.
A page in the application instantiates the web worker process.
You need to establish twoway communications between the web worker process and the
page.
Which two actions will achieve this goal? (Each correct answer presents a complete
solution.
Choose two.)
A.
B.
C.
D.

From the web worker, use the onconnect event handler of the main page to capture ev
ents.
From the main page, use the onmessage event handler of the web worker to capture ev
ents.
From the web worker, use the onmessage event handler of the main page to capture ev
ents.
From the main page, use the onconnect event handler of the web worker to capture ev
ents.

Correct Answer: BC
QUESTION 127
28You are developing an HTML5 web application that displays customer mailing addre
ss
information.
The application loads addresses from a web service by using AJAX.
The following code defines a Customer object and loads address data.

You need to implement the loadAddress function. Which code segment should you use?

A.

B.

C.

D.

Correct Answer: C

QUESTION 128
29You are developing an HTML5 web page.
The appearance of the text box must change when a user moves the focus to another e
lement on
the page.
You need to develop the page to respond to user action. Which line of code should y
ou use?
A.
B.
C.
D.

<input type=text onblur=resetStyle(this); />


<input type=text onfocus=resetStyle(this); />
<input type=text onreset=resetStyle(this); />
<input type=text onselect=resetStyle(this); />

Correct Answer: A

QUESTION 129
30DRAG DROP You are developing an online shopping application that accepts credit
cards for
payment. If the credit card number is invalid, the application must:
Generate an error . Assign 200 to the error number
Assign Invalid to the error description You need to write the code that
meets the
requirements.
How should you write the code? (To answer, drag the appropriate code segment or seg
ments to
the correct location in the answer area.
Each code segment may be used once, more than once, or not at all. You may need to
drag the
split bar between panes or scroll to view content.)
Select and Place:

Correct Answer:
QUESTION 130
31You are developing an HTML5 page that includes several paragraph elements. You h
ave the
following requirements:
Add a drop shadow that is one inch below the text in the paragraph
Set the radius of the drop shadow to five pixels
You need to style the paragraphs to meet the requirements.
Which CSS style should you use?
A.
B.
C.
D.

textshadow: 72pt 0pt 5pt


textshadow: 5px lin 0px;
textshadow: 72pt 5em 0px
textshadow: 72pt 0em 5px;

Correct Answer: B

QUESTION 131
32You are creating a web form that users will use to enter their personal informat
ion. The form
includes the following HTML.

You have the following requirements:


When a user enters an input box, the cell on the right must turn green.
When a user leaves an input box, the cell on the right must turn white.
You need to create the web form to meet these requirements.
Which code segment should you use?
A.

B.

C.

D.

Correct Answer: A

QUESTION 132
33You are developing a web page. You create a grid layout by using the following C
SS segment.
You have the following requirements:

You must place content in the first column of the second row.
The content must span two columns.
You need to ensure that the style of the grid meets the requirements. Which CSS seg
ment should
you use?

A.

B.

C.

D.

Correct Answer: A

QUESTION 133
34DRAG DROP You are creating an application by using HTML5 and CSS3. The styles fo
r the pages
are derived from five style sheets.
The styles are not being applied correctly to the pages in the application.
You need to apply the styles from highest priority to lowest priority.
In which order should you use the five style sheets?
(To answer, move the style sheet types from the list of style sheet types to the an
swer area and
arrange them in the correct order.)
Select and Place:

Correct Answer:

QUESTION 134
35You are developing a web page by using HTML5. You have the following requirement
s:

An H1 element must be placed at the top left corner of the page.


The size and location of the H1 element must not change if additional elem
ents are
added to the page.
You need to position the H1 element on the page.
Which CS53 style should you use?

A.
B.

C.

D.

Correct Answer: A

QUESTION 135
36You are styling a box object on a page by using CSS3.
You need to set the transparency of the object to 50%.
Which two C5S3 styles will achieve the goal? (Each correct answer presents a comple
te solution.
Choose two.)

A.

B.

C.
D.

Correct Answer: BC

QUESTION 136
37HOTSPOT You are developing a web page that will be accessed from various types o
f devices.
You have the following requirements:
The appropriate display resolution must be selected dynamically based on t
he device
connecting to the page.
Mobile devices with a maximum width of 480 pixels must be able to use the
page.
You need to ensure that the page displays correctly on any device.
How should you build the code? (To answer, select the appropriate options from the
dropdown
lists in the answer area.)

Hot Area:
Correct Answer:

QUESTION 137
38You are developing an HTML5 web application and are styling text.
You need to use the texttransform CSS property.
Which values are valid for the texttransform property?
A.
B.
C.
D.

hidden
blink
capitalize
linethrough

Correct Answer: C
QUESTION 138
39DRAG DROP You are developing a website that has many web pages with hyperlinks t
o other
sites.
You need to ensure that if a hyperlink contains an image, the linked web page opens
in a new
window.
Which jQuery code segment or segments should you use? (To answer, drag the appropri
ate line
of code to the correct location.
Each line of code may be used once, more than once, or not at all.
You may need to drag the split bar between panes or scroll to view content.)
Select and Place:

Correct Answer:
QUESTION 139
40You are developing a page that includes text and an illustration.
The web page resembles the following image.
You have the following requirements:
The illustration must be in the center of the page.
The text must flow around the left, right, top, and bottom of the illustra
tion.
You need to ensure that the layout of the web page meets the requirements. Which li
ne of code
should you use?
A.
B.
C.
D.

mswrapside: both;
mswrapside: clear;
mswrapside: maximum;
mswrapside: auto;

Correct Answer: A

QUESTION 140
41You are developing a web page that has a group of HI and H2 elements.
The page also includes a CSS class named underlineMe.
You have the following requirements:
The font color of all H1 and H2 elements must be changed to red.
The CSS class underlineMe must be applied to all H1 and H2 elements.
You need to update the web page to meet the requirements.
Which code segment should you use?

A.

B.

C.

D.

Correct Answer: D

QUESTION 141
42HOTSPOT You are developing an HTML5 application for a company. You apply the fol
lowing
style to a DIV element on a page.
Which illustration should you submit? (To answer, select the appropriate illustrati
on in the answer
area.)
Hot Area:

Correct Answer:

QUESTION 142
43DRAG DROP You are developing a web page that will be accessed from various types
of
devices.
You have the following requirements:
The appropriate display resolution must be selected dynamically based on t
he device
that is connecting to the page.
Mobile devices with a maximum width of 480 pixels must be able to use the
page.
You need to ensure that the page displays correctly on any device.
How should you build the code? (To answer, drag the appropriate media statement to
the correct
location. Each
media statement may be used once, more than once, or not at all.
You may need to drag the split bar between panes or scroll to view content.)
Select and Place:

Correct Answer:

QUESTION 143
44DRAG DROP You are developing a web page by using HTML5 and CSS3.
Hyperlinks on the page must be rendered with a style that reflects the last user ac
tion performed.
You need to style the four anchor elements in the document. In what order should yo
u specify the
four anchor selectors?
(To answer, move the appropriate anchor selectors from the list of CSS codes to the
answer area
and arrange them in the correct order.)
Select and Place:

Correct Answer:

QUESTION 144
45You are developing a web page that will be divided into three vertical sections.
The main
content of the site will be placed in the center section.
The two outer sections will contain advertisements. You have the following requirem
ents:
The main content section must be set to two times the width of the adverti
sing
sections.
The layout must be specified by using the CSS3 flexible box model.
You need to ensure that the visual layout of the page meets the requirements. Which
CSS3
property should you use?
A.
B.
C.
D.

boxorient
boxflexgroup
boxflex
boxdirection

Correct Answer: C

QUESTION 145
46You are developing an HTML5 page. The page includes the following code.

The inner paragraph must be exactly 15 pixels from the top left corner of the outer
paragraph.
You set the left style for the inner paragraph to the appropriate value.
You need to set the position property of the inner paragraph. Which value should yo
u use?
A.
B.
C.
D.

absolute
static
fixed
relative

Correct Answer: A

QUESTION 146
47You are developing a customer web form that includes the following HTML input fi
eld. <input
id=txtValue/>
If a customer enters a value in the input field, then it must be a numeric value.
You need to add validation to the input field.
Which HTML should you use?
A.
B.
C.
D.

<input id=txtValue typetext pattern=/# />


<input id=txtValue type=number />
<input id=txtValue type=integer />
<input id=txtValue type=text required=required/>

Correct Answer: B

QUESTION 147
48You are developing a customer web form that includes the following HTML. <input
id=txtValue/> You need to change the HTML markup so that customers can enter only
a valid
threeletter country code. Which HTML should you use?
A.
B.
C.
D.

<input id=txtValue type=code />


<input id=txtValue type=text pattern= [AZaz] {3} />
<input id=txtValue type=text required=required/>
<input id=txtValue type=country />

Correct Answer: B

QUESTION 148
49You are developing a web form that includes the following HTML. <input id=txtVa
lue
type=text />
You need to ensure that a value is entered into txtValue before the form is submitt
ed.
Which code segment should you use?
A.

B.

C.

D.

Correct Answer: A

QUESTION 149
50HOTSPOT
You are developing a form that captures a users email address by using HTML5 and j
Query.
The form must capture the email address and return it as a query string parameter.
The query string parameter must display the @ symbol used in the email address.
You need to implement this functionality. How should you develop the form? (To answ
er, select
the appropriate options from the dropdown lists in the answer area.)
Hot Area:
Correct Answer:
QUESTION 150
51You are developing a web page that consumes a Windows Communication Foundation (
WCF)
service.
The page includes the following code segment. var xhr = new XMLHttpRequest() ;
The page uses the xhrHandler() method to listen for changes to the request status o
f the WCF
service calls.
It uses the xmlToJavaScript() method to convert the response from the WCF service t
o a
JavaScript object.
The xhrHandler() method must be called automatically each time the request status c
hanges.
You need to add the event handler to the request object. Which line of code should
you use?
A.
B.
C.
D.

xhr.onCallback = xhrHandler;
xhr.onreadystatechange = xhrHandler;
xhr.readyState = xhrHandler;
xhr.status = xhrHandler;

Correct Answer: B

QUESTION 151
You are modifying an application that processes loans. The following code defines t
he Loan class.
(Line numbers are included for reference only.)
Loans are restricted to a maximum term of 10 years. The application must send a not
ification
message if a loan request exceeds 10 years.

You need to implement the notification mechanism.

Which two actions should you perform? (Each correct answer presents part of the sol
ution.
Choose two.)

Correct Answer: BD
Explanation:
B: Raise the event.
D: Declare the event handler.

QUESTION 152
An application contains code that measures reaction times. The code runs the timer
on a thread
separate from the user interface. The application includes the following code. (Lin
e numbers are
included for reference only.)
You need to ensure that the application cancels the timer when the user presses the
Enter key.

Which code segment should you insert at line 14?


A. tokenSource.Token.Register( () => tokenSource.Cancel() );
B. tokenSource.Cancel();
C. tokenSource.IsCancellationRequested = true;
D. tokenSource.Dispose();
Correct Answer: B

QUESTION 153
You are developing an application that generates code. The application includes the
following
code segment. (Line numbers are included for reference only.)

You need to ensure that code generated by the GenerateCode() method represents a cl
ass that
can be accessed by all objects in its application domain.

Which two code segments can you insert at line 05 to achieve this goal? (Each corre
ct answer
presents a complete solution. Choose two.)
Correct Answer: AC

QUESTION 154
You are developing an application that will process personnel records. The applicat
ion must
encrypt highly sensitive data. You need to ensure that the application uses the str
ongest available
encryption. Which class should you use?

A. System.Security.Cryptography.DES
B. System.Security.Cryptography.Aes
C. System.Security.Cryptography.TripleDES
D. System.Security.Cryptography.RC2

Correct Answer: B

QUESTION 155
You are developing an application that uses a .config file.

The relevant portion of the .config file is shown as follows:

You need to ensure that diagnostic data for the application writes to the event log
by using the
configuration specified in the .config file. What should you include in the applica
tion code?
Correct Answer: A

QUESTION 156
You are developing an application that includes a class named Employee and a generi
c list of
employees. The following code segment declares the list of employees:

List<Employee> employeesList = new List<Employee>();

You populate the employeesList object with several hundred Employee objects.

The application must display the data for five Employee objects at a time.

You need to create a method that will return the correct number of Employee objects
.

Which code segment should you use?

Correct Answer: B

QUESTION 157
DRAG DROP
You create an assembly named Assembly1.dll. You need to ensure that Assembly1.dll c
an be
deployed to the global assembly cache (GAC). Which commands should you run? (To ans
wer, drag
the appropriate programs to the correct locations. Each program may be used once, m
ore than
once, or not at all. You may need to drag the split bar between panes or scroll to
view content.)

Correct Answer:

QUESTION 158
DRAG DROP
You have an application that accesses a Microsoft SQL Server database.

The database contains a stored procedure named Proc1. Procl accesses several rows o
f data
across multiple tables.

You need to ensure that after Proc1 executes, the database is left in a consistent
state. While
Proc1 executes, no other operation can modify data already read or changed by Proc1
. (Develop
the solution by selecting and ordering the required code snippets. You may not need
all of the
code snippets.)
Correct Answer:
QUESTION 159
DRAG DROP
You have an application that uses paging. Each page displays 10 items from a list.

You need to display the third page. (Develop the solution by selecting and ordering
the required
code snippets. You may not need all of the code snippets.)

Correct Answer:

QUESTION 160
DRAG DROP
You have a method that will evaluate a parameter of type Int32 named Status.

You need to ensure that the method meets the following requirements:
If Status is set to Active, the method must return 1.
If Status is set to Inactive, the method must return 0.
If Status is any other value, the method must return 1.

What should you do? (To answer, drag the appropriate statement to the correct locat
ion in the
answer area. Each statement may be used once, more than once, or not at all. You ma
y need to
drag the split bar between panes or scroll to view content.)

Correct Answer:

QUESTION 161
You are developing an application that uses multiple asynchronous tasks to optimize
performance. You need to retrieve the result of an asynchronous task. Which code se
gment
should you use?
Correct Answer: C

QUESTION 162
You are developing an application.

The application contains the following code:


When you compile the code, you receive the following syntax error message: A previ
ous catch
clause already catches all exceptions of this or a super type (System.Exception).

You need to ensure that the code can be compiled. What should you do?

A. Catch the ArgumentException exception instead of the


ArgumentNullException exception.
B. Throw a new exception in the second catch block.
C. Catch the ArgumentNullException exception first.
D. Rethrow the exception caught by the second catch block.

Correct Answer: A

QUESTION 163
You are developing an application that includes a method named SendMessage.

You need to ensure that the SendMessage() method is called with the required parame
ters.

Which two code segments can you use to achieve this goal? (Each correct answer pres
ents a
complete solution. Choose two.)
Correct Answer: CD
Explanation:
D: ExpandoObject
Represents an object whose members can be dynamically added and removed at run time
. / The
ExpandoObject class enables you to add and delete members of its instances at run t
ime and also
to set and get values of these members. This class supports dynamic binding, which
enables you
to use standard syntax like sampleObject.sampleMember instead of more complex synta
x like
sampleObject.GetAttribute(sampleMember). / You can pass instances of the ExpandoO
bject
class as parameters. Note that these instances are treated as dynamic objects in C#
and late
bound objects in Visual Basic. This means that you do not have IntelliSense for obj
ect members
and you do not receive compiler errors when you call nonexistent members. If you c
all a member
that does not exist, an exception occurs.

Note:
* Visual C# 2010 introduces a new type, dynamic. The type is a static type, but an
object of type
dynamic bypasses static type checking. In most cases, it functions like it has type
object. At
compile time, an element that is typed as dynamic is assumed to support any operati
on.
Therefore, you do not have to be concerned about whether the object gets its value
from a COM
API, from a dynamic language such as IronPython, from the HTML Document Object Mode
l
(DOM), from reflection, or from somewhere else in the program. However, if the code
is not valid,
errors are caught at run time.

QUESTION 164
You have an application that accesses a Web server named Server1. You need to downl
oad an
image named Imagel.jpg from Server1 and store the image locally as Filel.jpg. Which
code should
you use?

Correct Answer: C

QUESTION 165
You are developing a C# application. The application references and calls a RESTful
web service
named EmployeeService. The EmployeeService web service includes a method named
GetEmployee, which accepts an employee ID as a parameter. The web service returns t
he
following JSON data from the method.

{Id:1,Name:David Jones>

The following code segment invokes the service and stores the result:

You need to convert the returned JSON data to an Employee object for use in the app
lication.

Which code segment should you use?


Correct Answer: C

QUESTION 166
You are developing an assembly. You plan to sign the assembly when the assembly is
developed.
You need to reserve space in the assembly for the signature. What should you do?

A. Run the Assembly Linker tool from the Windows Software


Development Kit (Windows SDK).
B. Run the Strong Name tool from the Windows Software Development
Kit (Windows SDK).
C. Add the AssemblySignatureKeyAttribute attribute the assembly.
D. Add the AssemblyDelaySignAttribute attribute to the assembly.

Correct Answer: D

QUESTION 167
You have the following code (line numbers are included for reference only):
You need to ensure that if an exception occurs, the exception will be logged.

Which code should you insert at line 28?

Correct Answer: A
Explanation:
* XmlWriterTraceListener
Directs tracing or debugging output as XMLencoded data to a TextWriter or to a Str
eam, such as
a FileStream.
QUESTION 168
You are troubleshooting an application that uses a class named FullName. The class
is decorated
with the DataContractAttribute attribute. The application includes the following co
de. (Line
numbers are included for reference only.)

You need to ensure that the entire FullName object is serialized to the memory stre
am object.

Which code segment should you insert at line 09?

A. binary.WriteEndElement();
B. binary.NriteEndDocument();
C. ms.Close() ;
D. binary.Flush();

Correct Answer: A
Explanation:
* DataContractSerializer.WriteEndObject Method (XmlDictionaryWriter) Writes the clo
sing XML
element using an XmlDictionaryWriter.

* Note on line 07: DataContractSerializer.WriteObject Method Writes all the object


data (starting
XML element, content, and closing element) to an XML document or stream.

XmlDictionaryWriter

QUESTION 169
You write the following method (line numbers are included for reference only):
You need to ensure that the method extracts a list of URLs that match the following
pattern:
@http://(www.)?([^.]+).com;

Which code should you insert at line 07?

Correct Answer: A
Explanation:
* MatchCollection
Represents the set of successful matches found by iteratively applying a regular ex
pression
pattern to the input string.
The collection is immutable (readonly) and has no public constructor. The Regex.Ma
tches
method returns a MatchCollection object.
* List<T>.Add Method
Adds an object to the end of the List<T>.
Incorrect:
Not D: ICollection.SyncRoot Property
For collections whose underlying store is not publicly available, the expected impl
ementation is to
return the current instance. Note that the pointer to the current instance might no
t be sufficient
for collections that wrap other collections; those should return the underlying col
lections
SyncRoot property.

QUESTION 170
You have the following code:
You need to retrieve all of the numbers from the items variable that are greater th
an 80.

Which code should you use?

Correct Answer: B
Explanation:
Enumerable.Where<TSource> Method (IEnumerable<TSource>, Func<TSource, Boolean>)
Filters a sequence of values based on a predicate.

Example:
List<string> fruits =
new List<string> { apple, passionfruit, banana, mango, orange, blueberry
, grape,
strawberry };

IEnumerable<string> query = fruits.Where(fruit => fruit.Length < 6);

foreach (string fruit in query)


{
Console.WriteLine(fruit);
}
/*

This code produces the following output:

apple
mango
grape
*/

QUESTION 171
You are developing an application that uses several objects. The application includ
es the following
code segment. (Line numbers are included for reference only.)

You need to evaluate whether an object is null.

Which code segment should you insert at line 03?

A. Option A
B. Option B
C. Option C
D. Option D

Correct Answer: B
Explanation:
Use the == operator to compare values and in this case also use the null literal.

QUESTION 172
You are implementing a new method named ProcessData. The ProcessData() method calls
a third
party component that performs a longrunning operation to retrieve stock informatio
n from a
web service.

The thirdparty component uses the IAsyncResult pattern to signal completion of the
long
running operation so that the UI can be updated with the new values.

You need to ensure that the calling code handles the longrunning operation as a
System.Threading.Tasks.Task object to avoid blocking the UI thread.

Which two actions should you perform? (Each correct answer presents part of the sol
ution.
Choose two.)

A. Create a TaskCompletionSource<T> object.


B. Call the component by using the TaskFactory.FromAsync() method.
Apply the following attribute to the ProcessData() method signature:
C. [Methodlmpl(MethodlmplOptions.Synchronized)]
D. Apply the async modifier to the ProcessData() method signature.

Correct Answer: AB
Explanation:
A: In many scenarios, it is useful to enable a Task<TResult> to represent an extern
al asynchronous
operation. TaskCompletionSource<TResult> is provided for this purpose. It enables t
he creation of
a task that can be handed out to consumers, and those consumers can use the members
of the
task as they would any other. However, unlike most tasks, the state of a task creat
ed by a
TaskCompletionSource is controlled explicitly by the methods on TaskCompletionSourc
e. This
enables the completion of the external asynchronous operation to be propagated to t
he
underlying Task. The separation also ensures that consumers are not able to transit
ion the state
without access to the corresponding TaskCompletionSource.

B: TaskFactory.FromAsync Method
Creates a Task that represents a pair of begin and end methods that conform to the
Asynchronous Programming Model pattern. Overloaded.

Example:
TaskFactory.FromAsync Method (IAsyncResult, Action<IAsyncResult>) Creates a Task th
at
executes an end method action when a specified IAsyncResult completes.

Note:
* System.Threading.Tasks.Task
Represents an asynchronous operation.

QUESTION 173
You are developing a class named Account that will be used by several applications.
The
applications that will consume the Account class will make asynchronous calls to th
e Account class
to execute several different methods. You need to ensure that only one call to the
methods is
executed at a time. Which keyword should you use?
A. sealed
B. protected
C. checked
D. lock

Correct Answer: D

QUESTION 174
You are developing an application by using C#. The application will write events to
an event log.
You plan to deploy the application to a server. You create an event source named My
Source and a
custom log named MyLog on the server. You need to write events to the custom log. W
hich code
segment should you use?

Correct Answer: D

QUESTION 175
You plan to store passwords in a Windows Azure SQL Database database. You need to e
nsure that
the passwords are stored in the database by using a hash algorithm. Which cryptogra
phic
algorithm should you use?

A. ECDSA
B. RSA768
C. AES256
D. SHA256

Correct Answer: D
QUESTION 176
HOTSPOT
You have an existing order processing system that accepts .xml files.

The following code shows an example of a properly formatted order in XML:

You create the following class that will be serialized:

For each of the following properties, select Yes if the property is serialized acco
rding to the
defined schema. Otherwise, select No.

Correct Answer:
QUESTION 177
You are developing an application that includes methods named ConvertAmount and
TransferFunds.

You need to ensure that the precision and range of the value in the amount variable
is not lost
when the TransferFunds() method is called.

Which code segment should you use?

Correct Answer: C
Explanation:
Simply use float for the TransferFunds parameter.
Note:
* The float keyword signifies a simple type that stores 32bit floatingpoint value
s.
* The double keyword signifies a simple type that stores 64bit floatingpoint valu
es

QUESTION 178
You need to write a console application that meets the following requirements:

If the application is compiled in Debug mode, the console output must display Enter
ing debug
mode.
If the application is compiled in Release mode, the console output must display Ent
ering release
mode.

Which code should you use?

A. Option A
B. Option B
C. Option C
D. Option D
Correct Answer: B
Explanation:
When the C# compiler encounters an #if directive, followed eventually by an #endif
directive, it
will compile the code between the directives only if the specified symbol is define
d. Unlike C and
C++, you cannot assign a numeric value to a symbol; the #if statement in C# is Bool
ean and only
tests whether the symbol has been defined or not. For example,
#define DEBUG
//
#if DEBUG
Console.WriteLine(Debug version);
#endif

QUESTION 179
DRAG DROP
You are adding a method to an existing application. The method uses an integer name
d
statusCode as an input parameter and returns the status code as a string.

The method must meet the following requirements:

Return Error if the statusCode is 0.


Return Success if the statusCode is 1.
Return Unauthorized if the statusCode is any value other than 0 or 1.

You need to implement the method to meet the requirements.

How should you complete the relevant code? (To answer, drag the appropriate stateme
nts to the
correct locations in the answer area. Each statement may be used once, more than on
ce, or not
at all. You may need to drag the split bar between panes or scroll to view content.
)

Correct Answer:
QUESTION 180
You have the following class (line numbers are included for reference only):

ServiceProxy is a proxy for a web service. Calls to the Update method can take up t
o five seconds.
The Test class is the only class the uses Class1.

You run the Execute method three times, and you receive the following results:

213

312

231

You need to ensure that each value is appended to the Value property in the order t
hat the
Modify methods are invoked.

What should you do?


Correct Answer: B

QUESTION 181
You are developing a method named GetHash that will return a hash value for a file.
The method
includes the following code. (Line numbers are included for reference only.)

You need to return the cryptographic hash of the bytes contained in the fileBytes v
ariable.

Which code segment should you insert at line 05?


Correct Answer: A

QUESTION 182
You are developing an application that includes the following code segment:

You need to implement the Open() method of each interface in a derived class named
UseResources and call the Open() method of each interface.

Which two code segments should you use? (Each correct answer presents part of the s
olution.
Choose two.)
Correct Answer: AC
Explanation:
* An interface contains only the signatures of methods, properties, events or index
ers. A class or
struct that implements the interface must implement the members of the interface th
at are
specified in the interface definition.

* Example:
interface ISampleInterface
{
void SampleMethod();
}

class ImplementationClass : ISampleInterface


{
// Explicit interface member implementation:
void ISampleInterface.SampleMethod()
{
// Method implementation.
}

static void Main()


{
// Declare an interface instance.
ISampleInterface obj = new ImplementationClass();

// Call the member.


obj.SampleMethod();
}
}

QUESTION 183
You are implementing a method named ProcessData that performs a longrunning task.
The
ProcessData() method has the following method signature:

public void ProcessData(List<decimal> values, CancellationTokenSource source,


CancellationToken token)

If the calling code requests cancellation, the method must perform the following ac
tions:

Cancel the longrunning task.


Set the task status to TaskStatus.Canceled.

You need to ensure that the ProcessData() method performs the required actions.

Which code segment should you use in the method body?

if (token.IsCancellationRequested)
A. return;
B. throw new AggregateException();
C. token.ThrowIfCancellationRequested();
D. source.Cancel();

Correct Answer: C
QUESTION 184
HOTSPOT
You have the following code (line numbers are included for reference only):

To answer, complete each statement according to the information presented in the co


de.

Correct Answer:

QUESTION 185
You are developing an application in C#.

The application uses exception handling on a method that is used to execute mathema
tical
calculations by using integer numbers.

You write the following catch blocks for the method (line numbers are included for
reference
only):

You need to add the following code to the method:

At which line should you insert the code?

A. 01
B. 03
C. 05
D. 07

Correct Answer: A

QUESTION 186
You are developing an application that uses multiple asynchronous tasks to optimize
performance. The application will be deployed in a distributed environment. You nee
d to retrieve
the result of an asynchronous task that retrieves data from a web service. The data
will later be
parsed by a separate task. Which code segment should you use?
Correct Answer: B
QUESTION 187
You are implementing a method named GetValidPhoneNumbers. The GetValidPhoneNumbers(
)
method processes a list of string values that represent phone numbers.

The GetValidPhoneNumbers() method must return only phone numbers that are in a vali
d format.

You need to implement the GetValidPhoneNumbers() method.

Which two code segments can you use to achieve this goal? (Each correct answer pres
ents a
complete solution. Choose two.)
Correct Answer: AB
Explanation:
* Regex.Matches
Searches an input string for all occurrences of a regular expression and returns al
l the matches.

* MatchCollection
Represents the set of successful matches found by iteratively applying a regular ex
pression
pattern to the input string.
The collection is immutable (readonly) and has no public constructor. The Regex.Ma
tches
method returns a MatchCollection object.

* List<T>.Add Method
Adds an object to the end of the List<T>.

QUESTION 188
DRAG DROP
You are developing an application that will write data to a file. The application i
ncludes the
following code segment. (Line numbers are included for reference only.)

You need to ensure that the WriteData() method will write data to a file.
Which four code segments should you insert in sequence at line 03? (To answer, move
the
appropriate code segments from the list of code segments to the answer area and arr
ange them
in the correct order.)

Correct Answer:

QUESTION 189
You need to create a method that can be called by using a varying number of paramet
ers. What
should you use?

A. derived classes
B. interface
C. enumeration
D. method overloading

Correct Answer: D
Explanation:
Member overloading means creating two or more members on the same type that differ
only in
the number or type of parameters but have the same name. Overloading is one of the
most
important techniques for improving usability, productivity, and readability of reus
able libraries.
Overloading on the number of parameters makes it possible to provide simpler versio
ns of
constructors and methods. Overloading on the parameter type makes it possible to us
e the same
member name for members performing identical operations on a selected set of differ
ent types.

QUESTION 190
You are creating an application that reads from a database. You need to use differe
nt databases
during the development phase and the testing phase by using conditional compilation
techniques.
What should you do?
A. Configure the Define TRACE constant setting in Microsoft Visual Studio.
B. Decorate the code by using the [DebuggerDisplay(Mydebug)] attribute.
C. Configure the Define DEBUG constant setting in Microsoft Visual Studio.
D. Disable the strongname bypass feature of Microsoft .NET Framework
in the registry.

Correct Answer: C
Explanation:
Use one debug version to connect to the development database, and a standard versio
n to
connect to the live database.

QUESTION 191
You are creating a class named Loan.

The Loan class must meet the following requirements:

Include a member that represents the rate for a Loan instance.


Allow external code to assign a value to the rate member.
Restrict the range of values that can be assigned to the rate member.

You need to implement the rate member to meet the requirements.

In which form should you implement the rate member?

A. public static property


B. public property
C. public static field
D. protected field

Correct Answer: B

QUESTION 192
You are creating a class library that will be used in a web application. You need t
o ensure that the
class library assembly is strongly named. What should you do?

A. use the csc.exe /target:Library option when building the application.


B. use the AL.exe commandline tool.
C. use the aspnet_regiis.exe commandline tool.
D. use the EdmGen.exe commandline tool.

Correct Answer: B
Explanation:
The Windows Software Development Kit (SDK) provides several ways to sign an assembl
y with a
strong name:
* Using the Assembly Linker (Al.exe) provided by the Windows SDK.
* Using assembly attributes to insert the strong name information in your code. You
can use
either the AssemblyKeyFileAttribute or the AssemblyKeyNameAttribute, depending on w
here the
key file to be used is located.
* Using compiler options such /keyfile or /delaysign in C# and Visual Basic, or the
/KEYFILE or
/DELAYSIGN linker option in C++. (For information on delay signing, see Delay Signi
ng an
Assembly.)
Note:
* A strong name consists of the assemblys identityits simple text name, version n
umber, and
culture information (if provided)plus a public key and a digital signature. It is
generated from an
assembly file (the file that contains the assembly manifest, which in turn contains
the names and
hashes of all the files that make up the assembly), using the corresponding private
key.
Microsoft?Visual Studio?.NET and other development tools provided in the .NET Frame
work SDK
can assign strong names to an assembly. Assemblies with the same strong name are ex
pected to
be identical.

QUESTION 193
You are creating a console application named App1.

App1 retrieves data from the Internet by using JavaScript Object Notation (JSON).

You are developing the following code segment (line numbers are included for refere
nce only):

You need to ensure that the code validates the JSON string.

Which code should you insert at line 03?


Correct Answer: D
Explanation:
The JavaScriptSerializer Class Provides serialization and deserialization functiona
lity for AJAX
enabled applications.

The JavaScriptSerializer class is used internally by the asynchronous communication


layer to
serialize and deserialize the data that is passed between the browser and the Web s
erver. You
cannot access that instance of the serializer. However, this class exposes a public
API. Therefore,
you can use the class when you want to work with JavaScript Object Notation (JSON)
in managed
code.

QUESTION 194
You are developing an application that includes methods named EvaluateLoan, Process
Loan, and
FundLoan. The application defines build configurations named TRIAL, BASIC, and ADVA
NCED.

You have the following requirements:

The TRIAL build configuration must run only the EvaluateLoan() method.
The BASIC build configuration must run all three methods.
The ADVANCED build configuration must run only the EvaluateLoan() and ProcessLoan()
methods.

You need to meet the requirements. Which code segment should you use?
Correct Answer: C

QUESTION 195
You are creating an application that processes a list of numbers.

The application must define a method that queries the list and displays a subset of
the numbers
to the user. The method must not update the list.

You need to create an extendable query by using LINQ.

What should you do?


Correct Answer: C

QUESTION 196
You are developing an application that will be deployed to multiple computers. You
set the
assembly name. You need to create a unique identity for the application assembly. W
hich two
assembly identity attributes should you include in the source code? (Each correct a
nswer presents
part of the solution. Choose two.)

A. AssemblyDelaySignAttribute
B. AssemblyCompanyAttribute
C. AssemblyProductAttribute
D. AssemblyCultureAttribute
E. AssemblyVersionAttribute

Correct Answer: DE
Explanation:
The AssemblyName object contains information about an assembly, which you can use t
o bind to
that assembly. An assemblys identity consists of the following:

Simple name.
Version number.
Cryptographic key pair.
Supported culture.
D: AssemblyCultureAttribute
Specifies which culture the assembly supports.
The attribute is used by compilers to distinguish between a main assembly and a sat
ellite
assembly. A main assembly contains code and the neutral cultures resources. A sate
llite assembly
contains only resources for a particular culture, as in [assembly:AssemblyCultureAt
tribute(de)]

E: AssemblyVersionAttribute
Specifies the version of the assembly being attributed. The assembly version number
is part of an
assemblys identity and plays a key part in binding to the assembly and in version
policy.

QUESTION 197
You are developing an application that contains a class named TheaterCustomer and a
method
named ProcessTheaterCustomer. The ProcessTheaterCustomer() method accepts a
TheaterCustomer object as the input parameter.

You have the following requirements:

Store the TheaterCustomer objects in a collection.


Ensure that the ProcessTheaterCustomer() method processes the TheaterCustomer objec
ts in
the order in which they are placed into the collection.

You need to meet the requirements.

What should you do?

Create a System.Collections.Stack collection. Use the Push() method to


add TheaterCustomer
objects to the collection, Use the Peek() method to pass the objects to the
A. ProcessTheaterCustomer() method.
Create a System.Collections.Queue collection. Use the Enqueue()
method to add TheaterCustomer
objects to the collection. Use the Dequeue() method to pass the objects to the
B. ProcessTheaterCustomer() method.
Create a System.Collections.SortedList collection. Use the Add()
method to add TheaterCustomer
objects to the collection. Use the Remove() method to pass the objects to the
C. ProcessTheaterCustomer() method.
Create a System.Collections.ArrayList collection. Use the Insert()
method to add TheaterCustomer
objects to the collection. Use the Remove() method to pass the objects to the
D. ProcessTheaterCustomer() method.

Correct Answer: B

QUESTION 198
You are debugging a 64bit C# application. Users report System.OutOfMemoryException
exceptions. The system is attempting to use arrays larger than 2 GB in size. You ne
ed to ensure
that the application can use arrays larger than 2 GB. What should you do?
A. Add the /3GB switch to the boot.ini file for the operating system.
set the IMAGE_FILE_LARGE_ADDRESS_AWARE flag in the image header for the application
B. executable file.
C. set the value of the gcAllowVeryLargeObjects property to true in the
application configuration file.
D. Set the value of the usermode virtual address space setting for the
operating system to MAX.

Correct Answer: C

QUESTION 199
You develop an application by using C#. The application counts the number of times
a specific
word appears within a set of text files. The application includes the following cod
e.
(Line numbers are included for reference only.)

You have the following requirements:


Populate the _wordCounts object with a list of words and the number of occurrences
of each
word.
Ensure that updates to the ConcurrentDictionary object can happen in parallel.

You need to complete the relevant code.

Which code segment should you insert at line 23?


Correct Answer: A

QUESTION 200
You are evaluating a method that calculates loan interest. The application includes
the following
code segment. (Line numbers are included for reference only.)

When the loanTerm value is 5 and the loanAmount value is 4500, the loanRate must be
set to 6.5
percent. You need to adjust the loanRate value to meet the requirements.

What should you do?

Replace line 15 with the following code segment:


A. loanRate = 0.065m;
Replace line 07 with the following code segment:
B. loanRate = 0.065m;
Replace line 17 with the following code segment:
C. interestAmount = loanAmount * 0.065m * loanTerm;
Replace line 04 with the following code segment:
D. decimal loanRate = 0.065m;

Correct Answer: A

Das könnte Ihnen auch gefallen