Which code segment should you use?
How should you develop the form?
HOTSPOT
You are developing a form that captures a user’s 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 used in the email address.
You need to implement this functionality.
How should you develop the form? (To answer, select the appropriate options from the drop-down
lists in the answer area.)
Which line of code should you use?
You 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 of the WCF
service calls. It uses the xmlToJavaScript() method to convert the response from the WCF service to a
JavaScript object.
The xhrHandler() method must be called automatically each time the request status changes.
You need to add the event handler to the request object.
Which line of code should you use?
Which code segment should you use?
You need to develop the application to meet the requirements
DRAG DROP
You are developing a web application that retrieves data from a web service. 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 by using binary format if possible
Retrieve and parse the data from the web service by using XML when binary format is not possible
You need to develop the application to meet the requirements.
What should you do? (To answer, drag the appropriate code segment to the correct location. 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.)
Which code segment should you use?
You are developing an application that consumes an external web service that returns the latest
stock rate.
The application has two methods:
+The getResults() method makes an AJAX web service request
+The ShowRate() method displays the stock rate from the web service response
You need to ensure that the ShowRate() method always displays the latest stock rate.
Which code segment should you use?
Which three statements should you implement in sequence?
DRAG DROP
You are developing an application that reads information from a file.
The application must:
+Execute a block of code if there is an error accessing the file
+Execute a second block of code whether or not there is an error accessing the file
You need to ensure that the error handling requirements are met.
Which three statements should you implement in sequence? (To answer, move the appropriate
statements from the list of actions to the answer area and arrange them in the correct order.)
How should you write the code?
HOTSPOT
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, select the appropriate option from the drop-down list in the answer area.)
Which code segment should you use?
How should you build the code segment?
DRAG DROP
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, drag the appropriate word to the correct
location in the code segment. Each word 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.)