Final Exam Final
Final Exam Final
Multiple Choices: Put you answer in the space provided on the right column.
1. Following HTML and CSS standards helps make your web pages Answer ____
a. display faster
b. less accessible
c. forward compatible
d. only a and c are true, b is not true
e. a, b, and c are all true
7. If you want to insert content/data from an external source into a web page, Answer ____
which language will NOT help?
a. CSS
b. SQL
c. JavaScript
d. PHP
1/10
8. Which of the following is most likely to happen if your page uses Answer ____
HTML instead of XHTML?
a. The page will NOT load in most web browsers
b. The page may not be compatible with come XML-based systems.
c. Both a and b are correct
10. In this CSS code, what is being set? body { color: #990000; } Answer ____
a. Text Color of only paragraphs
b. Background Color of the entire web page
c. Text Color of the entire web page
d. Background Color of the body element
11. Which of the following must be true in order to use PHP code in a web page? Answer ____
a. The web server must have PHP processor
b. The code must be inside the <head> tag
c. The code must be inside a <script> tag
d. All of the above
12. What PHP variable is used to access URL variables? Answer ____
a. $_FORM
b. $_FILES
c. $_GET
d. $_POST
13. What PHP function is used to start a user session? Answer ____
a. session_start()
b. session_init()
c. session()
d. $_SESSION
15. Which of the following is NOT a built-in associative array used by PHP? Answer ____
a. $_URL
b. $_FILES
c. $_GET
d. $_POST
15.5. What do ninja’s and princesses have in common? Think about it…really thing about it….
_________________________________________________________________________________________
2/10
16. Consider the following regular expression and select the most correct answer: Answer ____
^[a-zA-Z][a-z0-9]+$
17. Consider the following regular expression and select the most correct answer: Answer ____
^[a-z0-9]+@[a-z0-9]+.com$
18. You can make a web page more accessible by Answer ____
a. putting it on the a web server
b. using standard HTML and CSS
c. providing alternative style sheet for printers and screen readers
d. using a big font
e. a, b, and c are all correct; d is not really true
f. a, b, c, and d are all correct
20. Using a single linked style sheet for an entire web site is Answer ____
a. bad because the style sheet can be big and take a long time to download
b. bad because the style sheet gets downloaded repeatedly every time a page is requested
c. good because you can control the site’s appearance in one central place
d. good because it hides all your styles and people can’t steal your website code
21. What is the current standard for the structural layer of web pages? Answer ____
a. XHTML 1.0
b. CSS 2.0
c. PHP 4
d. all of the above
22. Which of the following does NOT reside on the server side? Answer ____
a. Apache software
b. Session variables
c. PHP files
d. Web browser software
3/10
22. When is a cookie saved on a user’s web browser? Answer ____
a. Only when a user submits a form.
b. Whenever a user requests a web page.
c. If a web page is loaded that includes JavaScript code that sets the cookie
d. If PHP is used to send back an http response header that sets the cookie
e. a, b, c, and d are all true.
f. Only c and d are true.
23. Cookies and session variables can be used to. Answer ____
a. Prevent browser actions from happening more than once
b. Logout users after a period time
c. Keep track of user activity
d. All of the above
24. Which of the following is not a scripting language used by web servers to Answer ____
connect to databases and dynamically generate web pages.
a. PHP
b. XML
c. ASP
d. ColdFusion
25. Consider the following PHP code: $var = “3” . “5”; Answer ____
$var will most likely be:
a. Integer 8
b. Integer 15
c. String “35”
d. Integer (ascii value of character 3 times ascii value of character 5)
28. Which CSS attribute is used to change the font size? Answer ____
a. font-size
b. text-size
c. size
d. font-family
29. Which CSS attribute is used to make text italic? Answer ____
a. text-decoration
b. text-style
c. italic
d. font-style
4/10
30. In a 3-tier web architecture, which tier is responsible for rendering a web page? Answer ____
a. server
b. client
c. database
36. In a standards-compliant web page, what is the outer-most structural tag? Answer ____
a. <head>
b. <body>
c. <html>
d. <script>
37. What language is commonly used to manipulate the behavioral layer of a web page? Answer ____
a. JavaScript
b. SQL
c. XML
d. CSS
5/10
For questions 38-41, consider the following code:
$fname = $_POST[“firstname”];
run_query("SELECT lastname WHERE First='$fname");
42. A web browser will automatically send the cookies set by a server back Answer ____
to the server for all http requests to the server. Why?
a. Otherwise, the server could never see if it set a cookie on the browser
b. Otherwise, the server would have to send a separate request when it needed to check a cookie value
c. The browser initiates all contact with the server, the server can not send a request to the browser
d. All of the above are true
43. Which of the following is not a PHP function used to interface with MySQL? Answer ____
a. mysql_post
b. mysql_select_db
c. mysql_connect
d. mysql_query
e. mysql_dance_with_princess
43.5. What is Dr. Breimer’s favorite Disney Princess and why? It’s OK, you can say, I won’t be offended.
__________________________________________________________________________________________
6/10
For questions 44-49, consider the following PHP code:
49. What might prevent the code above from printing all the data in the princesses table?
a. The while loop may not fetch all the rows
b. If there are 9 or more fields, the for loop will only print the first 8 fields
c. The SQL query does not select all the fields
d. The actual data is never printed; only the table structure is printed
7/10
True or False: Circle the correct answer (True of False) in the right column
50. HTML has tags and functions to connect to database servers. True or False (circle one)
51. JavaScript is typically used to access a web page’s DOM. True or False (circle one)
52. In PHP, $myvar and $myVar are the same variable True or False (circle one)
53. Relative URLs always start with http:// True or False (circle one)
54. In a 3-tier web architecture the web server and the True or False (circle one)
database server can be installed on the same computer.
55. SQL stands for Structured Query Language True or False (circle one)
56. Microsoft and Netscape were the two parties in the browser wars? True or False (circle one)
57. The Internic is the name of the organization that makes True or False (circle one)
recommendations about the standards for HTML and CSS
58. 640 X 480 is still the most popular screen resolution True or False (circle one)
59. PHP is used to define the structure of web pages True or False (circle one)
60. CSS is used to define the presentational layer of a web page True or False (circle one)
61. Apache is a scripting language similar to PHP True or False (circle one)
62. ASP is Microsoft’s commercial web server software True or False (circle one)
63. URL stands for Uniform Resource Language True or False (circle one)
64. The a in the <a> tag stands for anchor True or False (circle one)
65. The <script> is used to insert PHP code into a web page True or False (circle one)
66. The <head> tag includes the web page title True or False (circle one)
67. The <link> tag can be used to define a hypertext link True or False (circle one)
68. ASP and JSP are different server-side scripting languages True or False (circle one)
69. PHP stands for Princess-based Hypertext Preprocessor True or False (circle one)
70. MySQL is an open source database server True or False (circle one)
72. Storing data in a database (instead of files) help increase True or False (circle one)
data dependence and increase data redundancy
8/10
Short Answer: Place very brief and specific answer in the spaces provided
75. What HTML tag/element is used to insert drop-down menu into a form? _________________
http://www.abc-com.cn/html/home/etc/upload.php?extension=gif
79. What is the name of the URL variable (the variable name, not its value)? _________________
em { color: red; }
strong { color: blue; }
h1 {color: green; }
strong em {color: yellow; }
h1 em strong {color: purple; }
#myblockdiv {
margin: 15px 20px 30px 45px;
padding: 5px 10px 15px 20px;
width: 700px;
}
85. How much total width will myblockdiv actually take up? _________________
86. Describe what is wrong with this CSS code: <b> { color: black; }
_________________________________________________________________________________
9/10
For questions 87-89, consider the following HTML form:
87. How many form variables are defined in the form above? _________
88. How many form elements are defined in the form above? _________
89. Assuming this form was loaded in a web browser, what exactly happens when the user clicks the submit
button, i.e., submits this form?
90. Write the PHP code to print the form variables in the form above.
91. Write the CSS code to add a pink background color to a class selector called “princess”
______________________________________________________________________________
92. Write the HTML code to make the word Siena an absolute hyperlink to www.siena.edu
______________________________________________________________________________
93. While it might be more difficult to design a website with a database back-end, it might be a lot easier to
maintain a database-driven website. Why? Explain at least two reasons why database-driven websites are
easier to maintain.
(1) ________________________________________________________________________________
(2) ________________________________________________________________________________
94. Describe three of the four main advantages of standardization in the web design world.
(1) ________________________________________________________________________________
(2) ________________________________________________________________________________
(3) ________________________________________________________________________________
95. What did Frosty the Snowman first say when he came to life? ____________________________________
10/10