option
Cuestiones
ayuda
daypo
buscar.php

JavaScript by I&C

COMENTARIOS ESTADÍSTICAS RÉCORDS
REALIZAR TEST
Título del Test:
JavaScript by I&C

Descripción:
Nosotros amamos its

Fecha de Creación: 2025/03/13

Categoría: Otros

Número Preguntas: 14

Valoración:(2)
COMPARTE EL TEST
Nuevo ComentarioNuevo Comentario
Comentarios
NO HAY REGISTROS
Temario:

Question 26 of 40 You are writing a JavaScript program that collects employee data and stores it in a database. Your program handles a wide variety of data, including text and different types of numbers. You need to ensure that the program handles the data so that it can be stored in the database with the correct data type. For each code segment, determine the data type that is being handled. Move the appropriate data types from the list on the left to the correct code segments on the right. You may use each data type once, more than once, or not at all. Boolean. Number. Object. String. Undefined.

Question 18 of 40 You are creating a form that allows customers to choose the spice level of their food. If they choose Spicy, the page should display a warning. You write the following code. Line numbers are included for reference only. 01 <form name = “orderForm” action = “#” method = “post”> 02 <select name = “heatIndex” required> 03 <option>Mild</option> 04 <option>Medium</option> 05 <option>Spicy</option> 06 </select> 07 <button onclick = “checkWarning()”>Order</button> 08 </form> (You write the following JavaScript code to display the warning:) 09 function checkWarning(){ var option = document.forms.orderForm[“heatIndex”]; if (option == “Spicy”) { alert(“Spicy food: Good Luck!”); } } When you choose Spicy and click Order, the warning fails to display. You need to solve the problem What should you do?. Change line 07 to <button onchange = “checkWarning();”>Order</button>. Change line 07 to <button onclick = “checkWarning();”>Order</button>. Change line 10 to var option = document.forms.orderForm[“heatIndex”].value;. Change line 10 to var option.value = document.forms.orderForm[“heatIndex”];.

Question 1 of 40 You are creating a function name countdown. The function accepts a parameter named start, and displays a countdown from that number to (and including) zero in increments of one. Complete the code by selecting the correct option from each drop-down list. Note: You will receive partial credit for each correct selection. function countdown(start) { for ( [1] [2] [3] ){ console.log(i); } } Order the segments of code in the correct order. [1] i>=0; [2] var i=start; [3] i--. [1] var i=start; [2] i>=0; [3] i--. [1] i-- [2] var i=start; [3] i>=0;.

Question 34 of 40 You work as a JavaScript develop. You are writing a simple script that performs the following actions: Declares and initializes an array. Fills the array with 10 random integers. Adds every other number starting with the first element. Complete the code by selecting the correct option from each drop-down list. Note: You will receive partial credit for each correct selection. var numbers = [1] ; for (var i = 0; i < 10; i++) { numbers. [2] (Math.round(Math.abs(Math.random() * 10))); } var sum = 0; for (var j = 0; j < 10; j = j+2 ) { sum += [3] ; } console.log(sum);. [1] push [2] numbers[j] [3] []. [1] numbers[j] [2] push [3] []. [1] [] [2] push [3] numbers[j].

Question 3 of 40 You are creating a dynamic HTML page by using JavaScript The page displays an image of the sun. When the user moves the mouse pointer across the image, the image should change from the sun to the moon. When the user moves the mouse pointer away from the image, the image should revert to the sun. You need to write the code for the image swap. Which two events should you program for? (choose 2). onmouseup. onmouseenter. onmousedown. onmouseout. onmouseover.

Question 20 of 40 You are creating a script that will assign a category based on the user’s age. The script must implement the following rules: Assign users who are at least 24 years old but less than 36 years old to CAT1. Assign users who are at least 36 years old but less than 46 years old to CAT2. Assign all other users to CAT3. Complete the code by moving the appropriate code segments from the list on the left to the correct positions on the right. You may use each code segment once, more than once, or not at all. Note: There is more than one correct order. You will receive partial credit for each response. You will receive credit for any correct order. var category; [1] category = ‘CAT1’; [2] category = ‘CAT2’; [3] category = ‘CAT3’;. [1]. [2]. [3].

Question 27 of 40 You need to determine whether a string named str is empty. What is the correct syntax?. str == “null”. str == “empty”. str == null. str === “”.

Choose the best option. document.getElementById(“title”)textContent=“Wish List”,. document.getElementById(“showList”).innerHTML= text;.

Question 28 of 40 You are designing a web page with a script that must dynamically change the content of a paragraph element to display the value returned by the function randomQuote(). You write the following code. Line numbers are included for reference only. 01 <!DOCTYPE html> 02 <html> 03 <body> 04 <p id=“tester” onclick=“changeText()”>Click to change the content.</p> 05 <input type=“button” value=“Change Text” onclick=“changeText()” /> 06 <script> 07 function changeText() { 08 09 } 10 </script> 11 </body> 12 </html>. document.getElementById(“tester”).script = randomQuote();. document.getElementById(“tester”).innerHTML = randomQuote();. document.getElementById(“tester”).tittle = randomQuote();. document.getElementById(“tester”).value = randomQuote();.

Question 36 of 40 You are developing a web page that displays students registration information. You need to test the code to ensure that it retrieves and displays the student information correctly. Complete the code by selecting the correct option from each drop-down list. Note: You will receive partial credit for each correct selection. class student(firstName, lastName, major, year){. var newStudent = new student(“Sherlock”, “Sassafrass”, “IT”, “freshman”);. newStudent.info();.

Question 19 of 40 You are writing a web application that stores customer information in an array of objects. Each Customer object has the following properties: customerName lastOrderDate orderAmount You need to create and populate a list of customers and identify customers who placed orders in the last 3 years. Complete the code by selecting the correct option from each drop-down list. currentDate.getFullYear(). orderDate.getFullYear().

Question 24 of 40 In the first drop-down list, select the code that changes the button color when the page loads. In the second drop-down list, select the code that changes the button color when the user clicks the button. Note: You will receive partial credit for each correct selection. document.body.onload=changeColor();. document.getElementById(“btn”).onclick=changeColor();.

Question 35 of 40 Your company offers a 10 percent discount if the day of the week is Wednesday. You need to write a JavaScript function name getDiscount that meets the following requirements: Accepts the day of the week (day) as a string. Returns the appropriate discount. Complete the code by selecting the correct option from each drop-down list. switch (day) {. case “wednesday”:. default:.

Question 5 of 40 You are helping a coworker test the following form: 01 <!DOCTYPE html> 02 <html> 03 <body> 04 <h1>Contact Information</h1> 05 <form id=“contact” action=“processContact.php”> 06 <p>First name: <input type=“text” id=“fname”></p> 07 <p>Last name: <input type=“text” id=“lname”></p> 08 <p><input id=“sub” type=“button” value=“Submit form”></p> 09 </form> 10 <script>. The form will submit to a script named contact. The form will submit only if the first name and last name are Entered. The form will not submit because it is missing the submission method.

Denunciar Test