70-480 Exam - Programming in HTML5 with JavaScript and CSS3

certleader.com

Q1. You are building a web page for a newspaper publisher. 

. You have the following requirements: 

. The web page should split the content into columns that are at least 100 pixels wide. 

. 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. <div id="outer" style="width: 100px; column-fill: balance;">...</div> 

B. <div id="outer" style="width: 100px; column-gap: 10px;">...</div> 

C. <div id="outer" style="column-width: 100px; ">. . .</div> 

D. <div id="outer" style="width: 100px; columns: 100px 3">...</div> 

Answer: C

Q2. You are creating a class named Consultant that must inherit from the Employee class. The Consultant class must modify the inherited PayEmployee method. The Employee class is 

defined as follows. 

function Employee() {} 

Employee.prototype.PayEmployee = function ( ){ 

alertt'Hi 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 should 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; 

Answer: BC 

Q3. You develop an HTML5 webpage. You have the following JavaScript code: 

You need to handle the click event when a user clicks the show/Dialog button. 

Which code segment should you insert at line 02? 

A. $ (document).trigger("click", "#showDialog", function (e) { 

B. $ (document).on ("#showDialog", "click", function (e) { 

C. $(document).toggle("click", "#showDialog", function (e) { 

D. $(document).on("click", "#showDialog", function (e) { 

Answer: D

Q4. You develop an HTML5 webpage. You have the following HTML markup: 

You need to change the background color for all of the elements whose name attribute ends with the word name. 

Which code segment should you add to the webpage? 

A. $ ('input [name!="name"]’) .ess ({ 'background-color' : ' #E0ECF8'}) ; 

B. ${'input [name~="name"] ') .ess ({ 'background-color' : ' #E0ECF8' }) ; 

C. ${'input[name*="name"]').ess({'background=color': #E0ECF8'}); 

D. $( 'input [name$="name"] ') .ess ({ 'background-color' : '#E0ECF8'}); 

Answer: D

Q5. 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? 

A. text-shadow: 72pt 0pt 5pt 

B. text-shadow: 5px lin 0px; 

C. text-shadow: 72pt 5em 0px 

D. text-shadow: 72pt 0em 5px; 

Answer:

Q6. 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. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Q7. You are developing an application that processes order information. Thousands of orders are processed daily. The application includes the following code segment. (Line numbers are included for reference only.) 

The application must: 

. Display the number of orders processed and the number of orders remaining . Update the display for every 25th record processed 

You need to develop the application to meet these requirements. 

Which line of code should you insert at line 04? 

A. if (!(counter % 25)) 

B. if (counter == 25) 

C. if (counter >> 25 == 0) 

D. if (counter >> 25 == 0) 

Answer: A

Q8. You are troubleshooting a web page that includes the following code segment. 

You need to evaluate the value of the variable x. 

What will be displayed in the user interface? 

A. 0 

B. 1 

C. 2 

D. An error 

Answer: A

Q9. Your company uses a third-party component that generates HTML for a website. The third-party component creates DIV elements that display a yellow background. 

The third-party component uses inline styles in the DIV elements that are inconsistent with your corporate standards. You must override the DIV elements in the style sheet with the corporate styles. 

You need to ensure that the website meets corporate standards. 

Which style should you use? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer: C

Q10. You 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 solution. Choose two.) 

A. if (length = = = 75) 

B. if (length = = 75) 

C. if (length! = 75) 

D. if (length = = "75") 

Answer: BD