Latest Real 70-480 Tests Dumps and VCE Exam Questions 151-160

Ensurepass

QUESTION 151

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.

 

Select and Place:

clip_image002

 

Correct Answer:

clip_image004

 

 

QUESTION 152

You are developing a customer web form that includes following HTML.

 

<input id=”txtValue”/>

 

You need to develop the form so that customers can enter only a valid country code consisting of three English alphabet characters. Which code segment should you use?

 

A.       

clip_image005

 

B.       

clip_image006

 

C.       

clip_image007

 

D.       

clip_image008

 

Correct Answer: C

 

 

QUESTION 153

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?

 

A.       

clip_image009

 

B.       

clip_image010

C.       

clip_image011

 

D.       

clip_image012

 

Correct Answer: D

 

 

QUESTION 154

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.

 

Select and Place:

clip_image013

 

Correct Answer:

clip_image014

 

 

QUESTION 155

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.

 

Hot Area:

clip_image016

 

Correct Answer:

clip_image018

 

 

QUESTION 156

You are creating a JavaScript function to display the current version of a web application You declare a button as follows.

 

<input type=”button” id=”About” value=”About” />

 

You need to create an event handler for the button by using an anonymous function. Which code segment should you use?

 

A.       

clip_image020

 

B.       

clip_image022

 

C.       

clip_image024

 

D.       

clip_image026

 

Correct Answer: C

 

 

QUESTION 157

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.

Select and Place:

clip_image027

 

Correct Answer:

clip_image028

 

 

 

QUESTION 158

You are testing the value of the following variable in JavaScript.

 

var height = “300”;

 

A block of code must execute if the following conditions are true:

 

Ÿ   The height variable is set to 300.

Ÿ   The height variable is of type string.

 

You need to implement the code to run the test. Which line of code should you use?

 

A.      if (height = = 300)

B.      if (height = = = “300”)

C.      if (height ! “300”)

D.      if (height ! = 300)

 

Correct Answer: B

 

 

QUESTION 159

DRAG DROP

You are developing an application for an online retailer. The company ships only to certain countries. The application must:

 

Ÿ   Store a list of country codes in an array

Ÿ   Validate the country code of the shipping address against the countries array

Ÿ   Include a Boolean value in the array that indicates whether or not you can ship to the country

Ÿ   Display a list of countries that can be shipped to if the user inputs a code for a country that the retailer cannot ship to

 

You need to develop the application to meet the requirements. Which code segment or segments should you use?

 

To answer, drag the appropriate code segment or segments from the list of code segments to the correct 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:

clip_image030

 

Correct Answer:

clip_image032

 

 

QUESTION 160

DRAG DROP

You are creating a web worker for an HTML5 application. The following tasks 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 line of code should you use?

 

To answer, drag the appropriate line or lines of code to the correct location or locations. 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:

clip_image034

 

Correct Answer:

clip_image036