Ensurepass.com : Ensure you pass the IT Exams
2018 Aug Microsoft Official New Released 70-480
100% Free Download! 100% Pass Guaranteed!
Programming in HTML5 with JavaScript and CSS3
Question No: 61 – (Topic 2)
You are creating a class named Sedan that must inherit from the Car class. The Sedan class must modify the inherited fourDoor () method. The Car class is defined as follows.
Future instances of Sedan must be created with the overridden method. You need to write the code to implement the Sedan class.
Which two code segments should you use? (Each correct answer presents part of the solution. Choose two.)
-
Option A
-
Option B
-
Option C
-
Option D
Answer: B,C
Explanation: * The Object.prototype property represents the Object prototype object.
Object.prototype.constructor
Specifies the function that creates an object#39;s prototype.
Example:
Employee.prototype = new Person();
var Customer = function(name) { this.name = name;
};
Customer.prototype = new Person();
var Mime = function(name) { this.name = name; this.canTalk = false;
};
Mime.prototype = new Person(); Reference: Object.prototype
Question No: 62 – (Topic 2)
You 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.
-
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.
Answer: A,E
Question No: 63 – (Topic 2)
You are developing a customer web form that includes following HTML.
lt;input id= quot;textAccountTypequot;/gt;
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?
-
Option A
-
Option B
-
Option C
-
Option D
Answer: B
Explanation: HTML lt;inputgt; pattern Attribute
The pattern attribute specifies a regular expression that the lt;inputgt; element#39;s value is checked against.
Example
An HTML form with an input field that can contain only two letters (no numbers or special characters):
lt;form action=quot;demo_form.aspquot;gt;
Country code: lt;input type=quot;textquot; name=quot;country_codequot; pattern=quot;[A-Za-z]{2}quot; title=quot;Three letter country codequot;gt;
lt;input type=quot;submitquot;gt;
lt;/formgt;
Reference: HTML lt;inputgt; pattern Attribute http://www.w3schools.com/tags/att_input_pattern.asp
Question No: 64 – (Topic 2)
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?
-
xhr.onCallback = xhrHandler;
-
xhr.onreadystatechange = xhrHandler;
-
xhr.readyState = xhrHandler;
-
xhr.status = xhrHandler;
Answer: B
Explanation:
/ onreadystatechange: Sets or retrieves the event handler for asynchronous requests. Specifies a reference to an event handler for an event that fires at every state change readyState
Returns the state of the object as follows:
-
0 = uninitialized – open() has not yet been called.
-
1 = open – send() has not yet been called.
-
2 = sent – send() has been called, headers and status are available.
-
3 = receiving – Downloading, responseText holds partial data (although this functionality is not available in IE [3])
-
4 = loaded – Done.
/ Example (assuming that there is a function handler(): var oReq = getXMLHttpRequest();
if (oReq != null) {
oReq.open(quot;GETquot;, quot;http://localhost/test.xmlquot;, true); oReq.onreadystatechange = handler; oReq.send();
Reference: XMLHttpRequest object; XMLHttpRequest (XHR) https://msdn.microsoft.com/en-us/library/ie/ms535874(v=vs.85).aspx http://mrfwebdesign.blogspot.ca/2008/11/xmlhttprequest-xhr.html
Question No: 65 HOTSPOT – (Topic 2)
You review code that uses WebSockets for a browser-based multiplayer game. 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 moves:
For each statement in the table, select Yes if the code segment above causes the page to behave as described. Select No if it does not. Make only one selection in each column.
Answer:
Question No: 66 – (Topic 2)
You are developing an HTML5 page that includes several paragraph elements. You have 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?
-
Text-shadow: 72pt 0pt 5pt
-
Text-shadow: 5px lin 0px;
-
Text-shadow: 72pt 0em 5px;
-
Text-shadow: 100px 0px 5px;
Answer: B
Explanation: We set the second argument (vertical) to one inch (1in).
Note Syntax
text-shadow: h-shadow v-shadow blur color;
Note: The text-shadow property attaches one or more shadows to text. The property is a comma-separated list of shadows, each specified by 2 or 3 length values and an optional color. Omitted lengths are 0.
-
h-shadow
Required. The position of the horizontal shadow. Negative values are allowed
-
v-shadow
Required. The position of the vertical shadow. Negative values are allowed
-
blur
Optional. The blur distance
-
color
Optional. The color of the shadow.
Question No: 67 DRAG DROP – (Topic 2)
You create an HTML5 webpage. You have the following HTML markup:
You also have the following JavaScript code segment:
var jsonFruit = { quot;applesquot; : quot;12quot;, quot;bananasquot; : quot;8quot;, quot;watermelonquot; : quot;3quot; }
You need to add additional rows to the fruitTable element by processing the jsonFruit 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.)
Answer:
Explanation:
Box 1:
Box 2:
Box 3:
-
The appendTo() method inserts HTML elements at the end of the selected elements.
-
example to loop over a JavaScript array object.
var json = [
{quot;idquot;:quot;1quot;,quot;tagNamequot;:quot;applequot;},
{quot;idquot;:quot;2quot;,quot;tagNamequot;:quot;orangequot;},
{quot;idquot;:quot;3quot;,quot;tagNamequot;:quot;bananaquot;},
{quot;idquot;:quot;4quot;,quot;tagNamequot;:quot;watermelonquot;},
{quot;idquot;:quot;5quot;,quot;tagNamequot;:quot;pineapplequot;}
];
$.each(json, function(idx, obj) { alert(obj.tagName);
});
Question No: 68 – (Topic 2)
You 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 lines of code should you use? (Each correct answer presents part of the solution. Choose two.)
-
document.getEIementById(quot;picturequot;).style.position = quot;relativequot;;
-
document.getElementById(quot;picturequot;).style.top = quot;5pxquot;;
-
document.getEiementById(quot;picturequot;).style.top = quot;-5pxquot;;
-
document.getEIementById(quot;picturequot;).style.position = quot;absolutequot;;
Answer: A,B
Explanation: We use relative position to move the position 5 pixels lower on page. Using a negative value would move the picture higher on the page.
Note:
* The top property sets or returns the top position of a positioned element.
This property specifies the top position of the element including padding, scrollbar, border and margin.
Syntax
Set the top property: Object.style.top=quot;auto|length|%|inheritquot;
Where:
Length defines the top position in length units. Negative values are allowed
Question No: 69 DRAG DROP – (Topic 2)
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, drag the appropriate 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.)
Answer:
Explanation:
Example:
Drawing with JavaScript
lt;scriptgt;
var c = document.getElementById(quot;myCanvasquot;); var ctx = c.getContext(quot;2dquot;);
ctx.fillStyle = quot;#FF0000quot;; ctx.fillRect(0,0,150,75);
lt;/scriptgt;
Question No: 70 – (Topic 2)
You are developing an application that uses a JavaScript library. The library contains the following functions.
The application uses the following code. (Line numbers are included for reference only.)
The library may throw many types of exceptions. The exceptions are grouped by category. You need to catch and identify the exceptions by group.
Which code segment should you insert at line 05?
-
Option A
-
Option B
-
Option C
-
Option D
Answer: B Explanation: instanceof
The instanceof operator tests whether an object has in its prototype chain the prototype property of a constructor.
The instanceof operator tests presence of constructor.prototype in object prototype chain.
Example::
// defining constructors function C(){}
function D(){} var o = new C();
// true, because: Object.getPrototypeOf(o) === C.prototype o instanceof C;
// false, because D.prototype is nowhere in o#39;s prototype chain o instanceof D;
Reference: instanceof
100% Ensurepass Free Download!
–70-480 PDF
100% Ensurepass Free Guaranteed!
–70-480 Dumps
EnsurePass | ExamCollection | Testking | |
---|---|---|---|
Lowest Price Guarantee | Yes | No | No |
Up-to-Dated | Yes | No | No |
Real Questions | Yes | No | No |
Explanation | Yes | No | No |
PDF VCE | Yes | No | No |
Free VCE Simulator | Yes | No | No |
Instant Download | Yes | No | No |