CSIS-401: Web Design Final Exam Name: _______________________

landyaddaInternet και Εφαρμογές Web

10 Νοε 2013 (πριν από 3 χρόνια και 11 μήνες)

218 εμφανίσεις


1
/
10

CSIS
-
401: Web Design


Final Exam


Name: _______________________


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


2.
Which is an example of
purely presentational

HTML markup

Answer ____

a.

<p> paragraph content </p>

b.

<b> bold text </b>

c.

<div id=“pagetitle”>My Website</div>

d.

<img class= “playerphoto”
src= “Jordan.jpg”
title=”Michael Jordan”
/>


3. Which example is the most
semantic

Answer ____

e.

<p> paragraph content </p>

f.

<b> bold text </b>

g.

<div id=“pagetitle”>My Website</div>

h.

<img class= “playerphoto” src= “Jordan.jpg” title=”Michael Jordan” />


4
.
CSS

Answer ____

a.

is a markup language

b.

stands for
Core Style S
heet

c.

define
s

the presentational layer of a web page

d.

none of the above are true


5
.
What is NOT part of the client tier
?

Answer ____

a.

HTML code

b.

cookies

c.

session variables

d.

JavaScript

e.

DOM


6
.
JavaScript


Answer ____

a.

is a language used to define the
structural

layer of a web page

b.

is used in the database tier

c.

is typically used to communicate with the web server

d.

is used to manipulate the browser


7
. If you want
to insert
content/
data from an external source i
nto a web

page
,

Answer ____


which language will NOT help?

a.

CSS

b.

SQL

c.

JavaScript

d.

PHP



2
/
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 c
ompatible with
come
XML
-
based
systems
.

c.

Both a and b are correct


9
. Which of the following
is
a
full
-
featured

programming

language
?

Answer ____

a.

CSS

b.

PHP

c.

HTML

d.

SQL

e.

All of the above are full
-
featured programming languages


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.

$_FILE
S

c.

$_GET

d.

$_POST


1
3
. What PHP function is use
d

to
start

a user session?

Answer ____

a.

session_start()

b.

session_
init
()

c.

session()

d.

$_SESSION


1
4
. What has higher priority?

Answer ____


a.

Styles

define in a linked style sheet

b.

Embedded styles

c.

Inline styles


15.
Which of the following

is NOT
a built
-
in associative array used by PHP
?

Answer ____

a.

$_
URL

b.

$_FILE
S

c.

$_GET

d.

$_POST


15.5. What do ninja’s and princesses have in common? Think about it…really thing about it….


________________________________________________________________________
_________________


3
/
10


16. Consider the following regular expression and select the
most
correct answer:

Answer ____




^[a
-
zA
-
Z][a
-
z0
-
9]+$


a.

The pattern must start with a capital letter

b.

The pattern must contain exactly two characters

c.

The pattern must contain a
t least one letter

d.

The pattern must contain at least one numeric digit


1
7
. Consider the following regular expression and select the most correct answer:

Answer ____




^[a
-
z0
-
9]+@[a
-
z0
-
9]+.com$


a.

The pattern must end with .com

b.

The pattern can only contain
one dot

c.

The pattern can NOT have any capital letters

d.

All of the above are true


1
8
.
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


1
9
. Select the most correct statement

Answer ____


a.

Radio buttons are used when multiple options can be selected

b.

Check boxes are used when multiple op
tions can be selected


c.

Radio buttons can be used to submit a form.

d.

Check boxes can be used to submit a user text entry


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 ti
me to download

b.

bad because the style sheet get
s

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


2
1
.

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


2
2
.
Which of the following does NOT reside on the server side
?


Answer ____


a.

Apache

software

b.

Session variables

c.

PHP files

d.

Web brows
er software



4
/
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

s
end

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
use
rs
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



2
5
. 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
)


26
. Which HTML tag is the
most

semantic

Answer ____


a.

<i
>


b.


<b>


c.


<p>


27
. Which CSS attribute is used to
center

text?


Answer ____


a.

font
-
align


b.


text
-
align


c.


align


d.


center


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



5
/
10

30
. In a 3
-
tier web architecture, which tier is responsible for rendering a web page?


Answer ____


a.

server


b.

client


c.


database


31
. By default, the <p> tag is

Answer ____


a.

inline


b.

block


c.

float left


d. centered


32
. Which of the following is a

mark
-
up language
?

Answer ____

a.

CSS

b.

PHP

c.

HTML

d.

SQL

e.

all of the above are markup languages


33. Which of the following i
s a query language?

Answer ____

a.

CSS

b.

PHP

c.

JavaScript

d.

HTML

e.

SQL

f.

XML


34.

Why was ColdFusion so important?

Answer ____


a. It was the first server
-
side scripting language to support database connectivity


b. It was the first web server software


c. It was th
e first open source web development language


d. It was the first

client
-
side scripting language that could manipulate the browser


35.
Why is PHP so widely used

Answer ____


a. It is supported commercially by Microsoft and Oracle


b. It is free, open s
ource, and constantly expanded and updated


c. It is built into the Firefox web browser


d. It is endorsed by Princess Cinderella


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




6
/
10

For questions 38
-
41, consider the following code:



$
fname

= $_POST[“firstname”];


run_query("SEL
ECT lastname WHERE
First
='$
fname
");



38. What is $_POST?


Answer ____


a. An associative array


b. A PHP variable


c. A data structure containing all the form variables


d. All of the above


39. Which of the following is a PHP variable?


Answer ____


a. run_query


b. firstname


c. fname


d. First


40. Which of the following is a PHP function name?


Answer ____


a. run_query


b. firstname


c. fname


d. First


e. SELECT


41. What is
"SELECT lastname WHERE
First
='$
fname
"
?


Answer ____


a. a st
ring passed into a function


b. a
string

representing an SQL query


c. a regular expression


d. a and b are both true, c is not


e. a, b, and c are all true


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 init
iates all conta
ct 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.


__________________________________________________________________________________________



7
/
10

For

questions 44
-
49
, c
onsider the following PHP code
:


<table border="0" cellpadding="5" cellspacing="1" bgcolor=“black">

<?php

$results = run_query("SELECT * FROM princesses");

while ($row = mysql_fetch_array($results)) {


echo '<tr>';


for ($x = 0; $
x < 7; $x++)



echo '<td bgcolor="white">',
$row[$x],

'</td>';


echo '</tr>';

}

?>

</table>


44. Will this PHP
code

generate a standards
-
compliant
web page?


a. No, because
it doesn’t print

proper HTML and
DOCTYPE

headers


b. No, because you can NO
T mix HTML and PHP code together


c.
Yes, because it generates HTML code


d.
Yes, because the output is nested in
a
table.


4
5
. What does this PHP code do

exactly
?


a.
It tries to fit a glass slipper on all the princesses at the table


b.
It prints the

first 7 rows of the princesses table


c.
It prints the first 8 rows of the princesses table


d. It prints the
first 7 columns
of

all the rows of the princesses table


e. It prints the first 8 columns
of

all the rows of the princesses table


46.
In the
code above, what does
$results

store?


a. It stores the output of the run_query function


b. It stores the SQL query


c. It stores one row of data


d. It stores one column of data


e. It stores a delicious cheese sandwich


47. What does the
while

loop

do?


a.
For each loop, it generates a table row


b. I
t loops until the mysql_fetch_array function returns null (fals)


c. It loops for each row that is fetched


d.

It does all of the things: a, b, and c


48. What does the
for

loop do?


a. For each lo
op, it generates table data (a column)


b. It sets the background color of the table


c. It loops for each row that is fetched


d. It does all of the things: a, b, and c


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



8
/
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 server
s
.

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)


da
tabase 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

T
rue 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)


71.

Oracle is a commercial alternative to MySQL

True or False (circle one)


72.

Storing data in a dat
abase (instead of files) help increase

True or False (circle one)


data dependence and increase data
redundancy



9
/
10

Short Answer: Place very brief and specific answer in the spaces provided

73. What database server did we use in this course?

________________
_


74. What HTML tag/element is used to insert an image?

_________________


75. What HTML tag/element is used to insert
drop
-
down menu

into a form?

_________________

For questions
7
6
-
7
9
, c
onsider the following URL:



http://www.abc
-
com.cn/html/home/et
c/upload.php?extension=gif

76
. What is the top level domain?

_________________

77
.
This URL points to what type of file
?

_________________

78
. How many folders are in the file path?

_________________

79
.
What is the name of the URL variable (
the
variabl
e name,
not its value)
?

_________________

For questions 80
-
82, consider the following CSS code:


em { color: red; }

strong
{

color: blue; }

h1 {color: green; }

strong em {color: yellow; }

h1 em strong {color: purple; }


8
0
. What color will the text be?
<
em><strong>text<strong></em>



_________________



8
1
. What color will the text be?

<strong><em>
text</em></strong>



_________________



8
2
. What color will the text be?


<h1
><em>text
</em></h1>




_________________



For question 83
-
85, c
onsider the follow
ing CSS code
:


#myblockdiv {

margin: 15px 20px 30px 45px;

padding: 5px

10px 1
5px

20px
;

width: 700px;

}


8
3
. What is the top margin?









_________________


8
4
. What is the left padding?









_________________


8
5
. How much total width will
myblockdiv

actually take up?




_________________


86. Describe what is wrong with this CSS code:
<b> { color:
black
; }



_________________________________________________________________________________



10
/
10

For questions 87
-
89, c
onsider the following HTML form:


<for
m method="post" action="addcomment.php">

Subject:

<input name="subject" type="text" size=
"40"

class=
"
mytextbox
"
>

<br />

Name:

<input name="
user
name"
class=
"
mytextbox
"

type="text" size="40">

<br />

Comment:

<br

/>

<textarea na
me="comment" cols="60" rows=
"8"
></textarea>

<br

/>

<input type="submit" value="Submit">

</form>


87
.
H
ow many
form variables

are defined in the
form

above
?

____
_____


88. How many
form
elements

are defined in the form above?

_________


89
.
Assuming this for
m was loaded in a web bro
wser,
w
hat
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.





9
1
. Write the CSS code to add a
pink

background color to a class selector called

princess




______________________________________________________________________________


9
2
. Write the HTML code to make the
word
Siena

an absolute hyperlink to
www.siena.edu



_____________________________________
_________________________________________


9
3
. 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 a
re
easier to maintain.



(1) ________________________________________________________________________________




(2) ________________________________________________________________________________



9
4
.
Describe three of the four
main

advantages of standa
rd
ization in the web design world.



(1) ________________________________________________________________________________




(2) ________________________________________________________________________________












(3) _______________________________
_________________________________________________











95. What did Frosty the Snowman first say when he came to life? ____________________________________