Test Bank for Introduction to JavaScript Programming 1 st Edition by rake Link download full: http://testbankcollection.com/download/test-bank-for-introduction-to-javascriptprogramming-with-xml-and-php-1st-edition-by-drake Test Bank for hapter 1 MULTIPLE HOIE 1. Which is the first step in the program development cycle? a. design a program b. analyze the problem c. code the program and review the results d. test the program B 2. Which of the following is not a control structure? a. sequence b. selection c. syntax d. repetition 3. Which of the following is NOT one of the primary JavaScript data types? a. float b. numeric c. Boolean d. string 4. Which type of data type can have only one of two possible values? a. float b. numeric c. Boolean d. string 2014 Pearson Education 1
5. Which of the following is not an acceptable variable name? a. one_name b. name_one c. 1_Name d. thefirstname 6. Which of the following is not an acceptable variable name? a. my Friend b. your_friend c. We_re_ll_Friends d. all of the above are acceptable variable names 7. If the variable hours = 10, what is the value of the variable salary after the following instruction has been executed: salary = hours * 8 a. 10 b. 8 c. 80 d. cannot tell from the information given 8. Which tags are used to provide alternate content for users who have disabled scripts in their browsers? a. <noscript></noscript> b. <alt = "no script"> c. < /no script> d. there are no such tags 9. Which would be used to have a JavaScript function named hello() execute before the user views a web page? a. <script> JavaScript content </script> b. <body> <Javascript = hello()> c. <body onload = "hello()"> d. <hello()><body> 2014 Pearson Education 2
10. Which of the following describes a JavaScript object? 11. Which of the following describes a JavaScript method? 12. Which of the following describes a JavaScript property? B 13. Which method allows you to display text on an HTML page? a. onload b. show() c. display() d. write() 14. Which method will retrieve the contents of an HTML element? a. document.get() b. getelementbyid() c. innerhtml d. document.innerhtml B 15. Which would you use to replace the contents of an HTML page with the value stored in a variable named student? a. document.write(student); b. document.getelementbyid(student); 2014 Pearson Education 3
c. document.write(student.innerhtml); d. document.write(student.html); 16. Which of the following will open a new window named mywindow that is 500 pixels in height and 350 pixels wide? a. mywindow = new window(height = 600, width = 350); b. mywindow = window.open(height = 600, width = 350); c. mywindow = window.open(""; ""; height = "600"; width = "350"); d. mywindow = window.open("", "", "height = 600, width = 350"); 17. Which of the following will close a window named mywindow? a. close mywindow; b. mywindow = close(); c. mywindow.close(); d. mywindow.close; 18. Which of the following will prompt the user to enter his or her name? a. var name = window.open("what is your name?"); b. prompt("what is your name?", name); c. var name = document.write("what is your name?"); d. var name = prompt("what is your name?"); 19. Which is the correct way to define a function named getge()? a. function getge() b. getge = new function c. getge() d. new function getge() 2014 Pearson Education 4
20. Which of the following would retrieve the value displayed in a <div></div> element which has id = "football" and store that information in a variable named sport? a. sport = document.getelementbyid("football"); b. document.getelementbyid("football") = sport; c. sport = document.innerhtml(id = "football"); d. document.write("football"); TRUE/FLSE 1. True/False: The last step in the program development cycle is to code the program. F 2. True/False: prompt is used in a program to tell the user to enter some data. T 3. True/False: The onload event is used to have JavaScript execute before the user begins to view the page. T 4. True/False: The <script></script> tags are used only when you wish to include JavaScript within the body of a web page. F 5. True/False: The write() method can only be used to display text within <p></p> tags. F 6. True/False: In most cases the words function and method mean the same thing. T 7. True/False: To define a function, you must use the function keyword. T 8. True/False: The innerhtml property allows you to retrieve information from an element on a web page. F 9. True/False: Parameters are values that the user inputs to a program. F 10. True/False: The prompt() method allows you to prompt the user to input values. T 2014 Pearson Education 5