COP 2500 Final Exam Review (pt.1/3)
2. JavaScript is the same as Java and as HTML
False
1. JavaScript programs are executed by a JavaScript_________ in a Web browser.
Interpreter
3. JavaScript is a __________ programming language.
Loosely typed
15. When developing JavaScript programs, if the developer uses the type attribute for the <script></script> tag element, which of the following is correct?
a. "text/javascript"
9. Data hierarchy comprises bits, characters, __________, records, and files.
a. Fields
22. When using the typeof() function what does a value of null mean?
a. No valid data type
10. Numeric literals can be integers (whole numbers) and floating point (fractional numbers with a decimal point).
a. True
7. HTML Web page files are saved using file extension .htm or .html.
a. True
19. The variable named data is initialized as follows: var data = "Data data data"; and is reused later in the JavaScript program. Which of the following is not a valid reuse of the variable data?
a. data = 5.5
29. The following JavaScript code is described as switch (color) { case "blue": alert("cold"); case "red": alert("hot"); default: alert("No temperature selected"); }
a. switch b. Multi-way decision c. Alternative to the if/else if condition d. All of the above
8. Bit is short for __________.
b. Binary digit
14. JavaScript is a stand-alone scripting language like Perl and Python.
b. False
6. JavaScript can __________.
b. Improve website usability.
23. Primitive data types are assigned __________.
b. Single literal values
20. Assuming good HTML form and embedded <script></script>, when using concatenation what output would display based on the statement: document.write("The temperature is" + 89);
b. The temperature is89
4. Which of the following is not a valid data type of that a variable can hold?
b. const
24. What is the difference between document.write() and document.writeln()?
b. document.writeln() advances the cursor to the next line whereas document.write() does not
28. What operator is used for concatenation?
c. +
25. Which of the following is a valid block comment in JavaScript?
c. /* This is a block comment */
21. Assuming good HTML form and embedded <script></script>, when using concatenation what output would display based on the statement: document.write(102 + 201);
c. 303
26. Well-formed statements written in JavaScript end with __________.
c. ; (semi-colon)
13. JavaScript is used to enhance ________ Web pages for an interactive experience.
c. HTML
5. Which of the following is not part of the three layers of a Web page?
c. Java
17. Composite data types, also known as complex types, consist of more than one component. Valid composite data types include all of the following except __________.
c. Undefined
30. What is the primary difference between a while loop and a do/while loop?
c. While loops executes 0...n times; do/while loop executes 1...n times
12. To declare a constant, a value that cannot be changed during programming execution requires the use of keyword __________.
c. const
18. When naming variables in JavaScript, which of the following would not be valid?
c. var #32829;
11. Website lifecycle is a request/response loop. A request is made when __________.
d. A user types in www.ucf.edu in the URL text box of a Web browser and hits the enter key
27. The JavaScript logical not operator results in the __________.
d. Reverse evaluation of the condition
16. When asked to develop unobtrusive JavaScript this means that the JavaScript is __________.
d. Stored in an external file with a .js file extension