Advertisement
Guest User

Untitled

a guest
Dec 12th, 2017
644
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.67 KB | None | 0 0
  1. Question 1
  2. 0 out of 1.85 points
  3. A jQuery selector begins with a $ sign that refers to the jQuery ________________________.
  4. Question 2
  5. 1.85 out of 1.85 points
  6. When a JavaScript object is serialized,
  7. Question 3
  8. 1.85 out of 1.85 points
  9. The following code displays
  10. var text = "A111-B222-C333";
  11. if (/^\d{4}-\d{4}-\d{4}-\d{4}$/.test(text)) {
  12. alert("Valid1");
  13. } else if (/^\d{4}-\d{4}-\d{4}$/.test(text)) {
  14. alert("Valid2");
  15. } else {
  16. alert("NOT Valid");
  17. }
  18. Question 4
  19. 0 out of 1.85 points
  20. In most cases, the best way to find a jQuery plugin that performs a specific task is to
  21. Question 5
  22. 0 out of 1.85 points
  23. Binary is a format that uses 1’s and 0’s to represent data, while CSV, XML, and JSON are ______________________ formats that use letters and symbols to represent data.
  24. Question 6
  25. 1.85 out of 1.85 points
  26. To load a web page into a web browser, you can
  27. Question 7
  28. 0 out of 1.85 points
  29. Sometimes, validating the HTML code for a web page will help you debug an application, because
  30. Question 8
  31. 1.85 out of 1.85 points
  32. One of the benefits of using JSON is that it’s easy to work with when you’re using ______________________.
  33. Question 9
  34. 1.85 out of 1.85 points
  35. Which of the following statements about an array of arrays is true?
  36. Question 10
  37. 1.85 out of 1.85 points
  38. Which of the following is used in a regular expression pattern to match the beginning of a string?
  39. Question 11
  40. 1.85 out of 1.85 points
  41. The six data types allowed in JSON are strings, numbers, Booleans, arrays, objects, and
  42. Question 12
  43. 1.85 out of 1.85 points
  44. The following code
  45. var display_error = function(message) {
  46. alert("Error: " + message);
  47. }
  48. Question 13
  49. 1.85 out of 1.85 points
  50. Code example 10-1
  51.  
  52. var add = function( x, y ) {
  53. return ( x + y );
  54. }
  55.  
  56. alert( add (5, 3) );
  57.  
  58.  
  59. (Refer to code example 10-1.) The function
  60. Question 14
  61. 0 out of 1.85 points
  62. The ________________ are the jQuery UI components that you’re most likely to use.
  63. Question 15
  64. 1.85 out of 1.85 points
  65. What text does the following code display in a dialog box?
  66. alert("The file is in \"C:\\My Documents\"");
  67. Question 16
  68. 0 out of 1.85 points
  69. What method of the String object searches the string for an occurence of the specified search string?
  70. Question 17
  71. 0 out of 1.85 points
  72. The jQuery plugins require the use of the ________________ library.
  73. Question 18
  74. 1.85 out of 1.85 points
  75. JavaScript code runs on the
  76. Question 19
  77. 1.85 out of 1.85 points
  78. Code example 17-2
  79. A plugin that highlights menu items
  80.  
  81. (function($){
  82. $.fn.highlightMenu = function(options) {
  83. var o = $.extend({
  84. "mouseoverClass" : "mouseover",
  85. "mouseoutClass" : "mouseout",
  86. "useMouseout" : true
  87. }, options);
  88.  
  89. return this.each(function() {
  90. var items = $(this).find("a");
  91. items.mouseover(function() {
  92. $(this).addClass(o.mouseoverClass);
  93. if (o.useMouseout) {
  94. $(this).removeClass(o.mouseoutClass);
  95. }
  96. });
  97. items.mouseout(function() {
  98. $(this).removeClass(o.mouseoverClass);
  99. if (o.useMouseout) {
  100. $(this).addClass(o.mouseoutClass);
  101. }
  102. });
  103. });
  104. };
  105. })(jQuery);
  106.  
  107.  
  108. (Refer to code example 17-2) If this plugin is used with a menu that contains 10 items, how many elements is the plugin function applied to?
  109. Question 20
  110. 0 out of 1.85 points
  111. When you test an application with Chrome’s developer tools and a breakpoint is reached, you can click
  112. Question 21
  113. 1.85 out of 1.85 points
  114. Which of these for statements displays even numbers from 0 to 10?
  115. Question 22
  116. 1.85 out of 1.85 points
  117. Which of the following jQuery methods can you use to set the text of an element?
  118. Question 23
  119. 1.85 out of 1.85 points
  120. A function for the ready event method will run any methods that it contains as soon as the _______________________ is ready.
  121. Question 24
  122. 1.85 out of 1.85 points
  123. What is the value of random after the following code executes?
  124. var random = Math.floor(Math.random() * 10);
  125. random = random + 1;
  126. Question 25
  127. 1.85 out of 1.85 points
  128. The ______________________ method of the JSON object converts a JavaScript object to a JSON string.
  129. Question 26
  130. 1.85 out of 1.85 points
  131. What property of the Radio object is used to determine if a radio button is selected?
  132. Question 27
  133. 0 out of 1.85 points
  134. If a JavaScript object has a toJSON method, and a replacer function is passed to the stringify method,
  135. Question 28
  136. 1.85 out of 1.85 points
  137. What is the value of selected when the following code executes?
  138. var num = "three";
  139. var selected = num && parseFloat(num) || num || "";
  140. Question 29
  141. 1.85 out of 1.85 points
  142. Given the following lines of code, what will be displayed in successive dialog boxes?
  143. var answers = [ "C", "B", "D", "A" ];
  144. delete answers[3];
  145. for ( var i = 0; i < answers.length; i++ ) {
  146. alert(answers[i]);
  147. }
  148. Question 30
  149. 1.85 out of 1.85 points
  150. To use a jQuery UI widget, you must code both the ________________ and the jQuery code in the way that’s prescribed for the widget.
  151. Question 31
  152. 1.85 out of 1.85 points
  153. After the if statement that follows is executed, what will the value of discountAmount be?
  154. var discountAmount;
  155. var orderTotal = 200;
  156. if (orderTotal > 200) {
  157. discountAmount = orderTotal * .3;
  158. } else if (orderTotal > 100) {
  159. discountAmount = orderTotal * .2;
  160. } else {
  161. discountAmount = orderTotal * .1;
  162. }
  163. Question 32
  164. 1.85 out of 1.85 points
  165. What method of the Math object can be used to return the largest value from the values that are passed to it?
  166. Question 33
  167. 1.85 out of 1.85 points
  168. Which of the following is a benefit of using the JSON data format?
  169. Question 34
  170. 1.85 out of 1.85 points
  171. Code example 11-3
  172.  
  173. var Employee = function(firstName, lastName) {
  174. this.firstName = firstName;
  175. this.lastName = lastName;
  176. };
  177.  
  178. Employee.prototype.getFullName = function() {
  179. return this.firstName + " " + this.lastName;
  180. };
  181.  
  182.  
  183. (Refer to code example 11-3.) The following code displays
  184. var employee = new Employee("Grace", "Hopper");
  185. employee.lastName = "Murach";
  186. alert (employee.getFullName());
  187. Question 35
  188. 1.85 out of 1.85 points
  189. What is the value of the message variable after the following code executes?
  190. var message = "";
  191. for (var i = 0; i < 5; i++ ) {
  192. message += "L:" + i + ",";
  193. }
  194. Question 36
  195. 1.85 out of 1.85 points
  196. When you develop a web page, you should use HTML to provide
  197. Question 37
  198. 1.85 out of 1.85 points
  199. After the statements that follow are executed,
  200. var firstName = "Ray", lastName = "Harris";
  201. var fullName = lastName;
  202. fullName += ", ";
  203. fullName += firstName;
  204. Question 38
  205. 0 out of 1.85 points
  206. The code that follows has a bug in it because the second use of the variable named salesTax is spelled with all lowercase letters (salestax).
  207. var calculateTax = function(subtotal,taxRate) {
  208. var salesTax = subtotal * taxRate;
  209. salestax = parseFloat(salesTax.toFixed(2));
  210. return salesTax;
  211. }
  212. Assuming that there are no other problems and that you’re using strict mode, what will happen when this code is executed?
  213. Question 39
  214. 1.85 out of 1.85 points
  215. Which of the following is a valid statement for declaring and initializing a variable named length to a starting value of 120?
  216. Question 40
  217. 0 out of 1.85 points
  218. What does the second statement that follows do?
  219. var numbers = [1, 2, 3, 4];
  220. numbers.length = 0;
  221. Question 41
  222. 1.85 out of 1.85 points
  223. What does the following jQuery code do?
  224. $("#image").attr("src", imageURL);
  225. Question 42
  226. 1.85 out of 1.85 points
  227. All JSON data types are represented as key/value pairs, with the key name in
  228. Question 43
  229. 1.85 out of 1.85 points
  230. Code example 4-1
  231.  
  232. var add = function( x, y ) {
  233. return ( x + y );
  234. }
  235. alert( add (5, 3) );
  236.  
  237.  
  238. (Refer to code example 4-1) The alert method in this example
  239. Question 44
  240. 1.85 out of 1.85 points
  241. If a numerical operation returns a number greater than the largest possible JavaScript value, it returns
  242. Question 45
  243. 1.85 out of 1.85 points
  244. Code example 16-2
  245.  
  246. var employee = {
  247. name: "G. Hopper",
  248. start: new Date("1/1/2000"),
  249. salary: 90000
  250. };
  251. var regions = ["northwest", "southwest", "central", "east"];
  252.  
  253.  
  254. var replacer = function (key, value) {
  255. if (key === "") { return value; }
  256. if (key === "salary") { return undefined; }
  257. if (typeof value === "string") {
  258. var first = value.substring(0,1).toUpperCase();
  259. var remaining = value.substring(1);
  260. return first + remaining;
  261. } else { return value; }
  262. };
  263.  
  264.  
  265. (Refer to code example 16-2) What JSON string does the following code produce?
  266. JSON.stringify(employee, replacer);
  267. Question 46
  268. 1.85 out of 1.85 points
  269. To call a jQuery method, you code a _____________________ that represents one or more elements, the dot operator, and the method name.
  270. Question 47
  271. 1.85 out of 1.85 points
  272. Given a Date object named due_date, which of the following statements sets the month to February?
  273. Question 48
  274. 0 out of 1.85 points
  275. What does the code that follows do?
  276. $("email").firstChild.nodeValue = "Entry is invalid.";
  277. Question 49
  278. 1.85 out of 1.85 points
  279. Which method returns the elements of an array in a string separated by a comma?
  280. Question 50
  281. 0 out of 1.85 points
  282. Which of the following is NOT one of the three testing phases of a JavaScript application?
  283. Question 51
  284. 1.85 out of 1.85 points
  285. Which method of a regular expression searches a string and returns true if the pattern is found?
  286. Question 52
  287. 1.85 out of 1.85 points
  288. What happens when an exception is thrown inside a try block?
  289. Question 53
  290. 0 out of 1.85 points
  291. Which property of an Error object stores the type of error?
  292. Question 54
  293. 1.85 out of 1.85 points
  294. Code example 16-1
  295.  
  296. var json = "[{\"task\":\"Do taxes\",\"due\":\"2016-04-15T07:00:00.000Z\"}";
  297. json = json + ",{\"task\":\"Do Laundry\"}]";
  298. var tasks = JSON.parse(json);
  299.  
  300.  
  301. (Refer to code example 16-1) What JavaScript does this code produce?
  302. Question 55
  303. 1.85 out of 1.85 points
  304. What is displayed when the following code executes?
  305. var age = 19, score = 750;
  306. if ( age >= 21 && score >= 700 ) {
  307. alert ("Loan approved");
  308. } else if ( age >= 21 && score >= 650 ) {
  309. alert ("Cosigner needed.");
  310. } else if ( age >= 18 && score >= 680 ) {
  311. alert ("Two cosigners needed.");
  312. } else {
  313. alert ("Loan denied.");
  314. }
  315. Question 56
  316. 1.85 out of 1.85 points
  317. Which of the strings matches the following pattern?
  318. /^[01]?\d\/[0-3]\d\/\d{4}$/
  319. Question 57
  320. 1.85 out of 1.85 points
  321. Which of the following causes the parse method to throw an exception?
  322. Question 58
  323. 0 out of 1.85 points
  324. The jQuery functions will work in all browsers because they are coded and tested for _________________________ compatibility.
  325. Question 59
  326. 1.85 out of 1.85 points
  327. After the statement that follows is executed, rateText represents
  328. var rateText = document.getElementById("rate");
  329. Question 60
  330. 1.85 out of 1.85 points
  331. All parameters passed to a function are available in what property of the function?
  332. Question 61
  333. 1.85 out of 1.85 points
  334. What does the match method of a String object return if the global flag is set and a match is found?
  335. Question 62
  336. 1.85 out of 1.85 points
  337. If you download the jQuery core library, you can include it in a web page by coding a ____________________ element.
  338. Question 63
  339. 0 out of 1.85 points
  340. If you’re using the Chrome browser and a JavaScript application stops running due to an error in the JavaScript code, you can identify the statement that caused the error by
  341. Question 64
  342. 1.85 out of 1.85 points
  343. What does the following jQuery code do?
  344. $("h2").prev();
  345. Question 65
  346. 1.85 out of 1.85 points
  347. Code example 10-1
  348.  
  349. var add = function( x, y ) {
  350. return ( x + y );
  351. }
  352.  
  353. alert( add (5, 3) );
  354.  
  355.  
  356. (Refer to code example 10-1.) This code
  357. Question 66
  358. 1.85 out of 1.85 points
  359. When a function’s this keyword is undefined, how was the function invoked?
  360. Question 67
  361. 1.85 out of 1.85 points
  362. How can you clear a check from a Checkbox object?
  363. Question 68
  364. 1.85 out of 1.85 points
  365. What can you use to clarify the order of relational and logical operations in a conditional expression?
  366. Question 69
  367. 1.85 out of 1.85 points
  368. When a data structure is ______________________, it’s converted to a format that can be transmitted and stored.
  369. Question 70
  370. 1.85 out of 1.85 points
  371. A coding error that produces the wrong results when the application is run is known as a
  372. Question 71
  373. 1.85 out of 1.85 points
  374. For the following code, an event handler named investment_change is
  375. var investment_change = function() {
  376. var years = parseInt( $("years").value );
  377. alert("Years: " + years);
  378. }
  379.  
  380. window.onload = function() {
  381. $("investment").onchange = investment_change;
  382. }
  383. Question 72
  384. 1.85 out of 1.85 points
  385. Three of the common CSS selectors select
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement