CIS 148 Introduction to Database Driven Web Sites Exercise Set 2A

advertisement
CIS 148 Introduction to Database Driven Web Sites
Student Name Answer Key
Exercise Set 2A
Section ___ Date _______
Introduction to PHP
Multiple Choice: Identify the letter of the choice that best completes the statement or answers the question.
_____ (1)
_____ (2)
_____ (3)
_____ (4)
_____ (5)
_____ (6)
_____ (7)
_____ (8)
_____ (9)
_____ (10)
_____ (11)
_____ (12)
_____ (13)
_____ (14)
_____ (15)
PHP stands for _____ .
(a) Personal Home Page
(b) Personal Home Programming
(c) Professional Home Programming (d) Particular Home Pages
PHP was created by _____ .
(a)
William Shockley
(b)
Bjarne Stroustrup
(c)
John Backus
(d)
Rasmus Lerdorf
There are currently _____ million Web sites using PHP .
(a) 1.5
(b)
75
(c)
3.5
(d)
15
PHP is known as a(n) ______ software product.
(a)
proprietary
(b)
expensive
(c)
open source
(d)
buggy
PHP is a tool that can be used to develop Web sites like the following ______ .
(a)
dynamic Web sites
(b)
e - commerce Web sites
(c)
commercial Web sites (d)
All of the above
PHP can connect to the following database types _____ .
(a) MySQL
(b) ODBC
(c) ORACLE
(d) All of these
PHP can be found at the following Web site _____ .
(a)
www.php.org
(b)
www.php.net
(c)
www.php.gov
(d)
www.php_open.ca
PHP can be used on the following OS platforms _____ .
(a)
MS - Windows (b)
UNIX
(c)
Linux
(d)
All of these
Use the ____ symbol to make inline code comments in PHP .
(a) @
(b) #
(c) &
(d) $
Use the ____ symbols to make full line code comments in PHP .
(a) &&
(b) ^^
(c) //
(d) **
External files can be incorporated into PHP files with the ____ function.
(a)
input(...)
(b)
include(...)
(c)
insert(...)
(d)
import(...)
_________ are the 2 main types of variables that PHP uses.
(a)
Logical and array
(b)
Comparison and array
(c)
Scalar and array
(d)
Scalar and logical
The _____ command shows information on a Web browser from within PHP
code and returns a value of 1 or 0 depending on success or failure.
(a)
print(...)
(b)
array(...)
(c)
echo(...)
(d)
post(...)
A construct that performs indefinitely until a certain condition becomes true is
called _____ .
(a)
if - then
(b)
switch - case
(c)
do - while
(d)
for - next
The _________ portion of the switch - case construct is used to do anything that
the other case condition tests do not handle.
(a)
otherwise;
(b)
switch_else;
(c)
default;
(d)
case_else;
© Copyright 2011 by P.E.P.
1
CIS 148 Introduction to Database Driven Web Sites
Student Name Answer Key
_____ (16)
_____ (17)
_____ (18)
_____ (19)
_____ (20)
_____ (21)
_____ (22)
_____ (23)
_____ (24)
_____ (25)
_____ (26)
_____ (27)
_____ (28)
_____ (29)
_____ (30)
Exercise Set 2A
Section ___ Date _______
All statements in PHP are terminated with a _____
(a)
;
(b)
%
(c)
&
(d)
}
When accessing a PHP file ( or any Web enabled file ) that is being served from
your local machine, always precede it with ______ .
(a)
http://mydocs
(b)
http://home
(c)
http://localhost
(d)
http://webfiles
Operators are symbols that are typically used to _______ .
(a)
assign values
(b)
determine a course of action
(c)
perform math functions (d)
All of these
The for ... next loop in PHP has the following syntax sections _____ .
(a)
for ( start condition, value adjustment, end condition )
(b)
for ( value adjustment, start condition, end condition )
(c)
for ( start condition, end condition, value adjustment )
(d)
for ( end condition, start condition, value adjustment )
PHP uses what kind of development tool?
(a)
Ink jet printer (b)
Any ASCII text editor
(c)
Pad and pencil (d)
None of these
PHP can be served by ______ .
(a)
Netscape Navigator
(b)
Mosaic
(c)
Windows Explorer
(d)
Apache
PHP can be set apart from HTML with the ______ tags.
(a)
{? ... ?}
(b)
[% ... %]
(c)
<? ... ?>
(d)
<! ... !>
When you forget to end a PHP statement with a ; ( semicolon ) you generate
a(n) ______ error.
(a)
parsing
(b)
interpreter
(c)
compiler
(d)
divide by 0
To assign a variable a data value, use the _____ symbol.
(a)
>
(b)
==
(c)
<
(d)
=
To test the equal value between two variables, use the _______ symbol(s)
(a)
==
(b)
= = ! (c)
=>
(d)
<=>
The scope of a variable can be _____.
(a)
global
(b)
local
(c)
Both (a) and (b)
(d)
None of these
If you want to use the " ( double quotation mark ) character with a PHP string,
offset it with the ___ character.
(a)
/
(b)
%
(c)
\
(d)
?
When testing for 2 possible conditions to be true use the ____ characters
between the elements.
(a)
&&
(b)
||
(c)
!!
(d)
%=
When testing for 2 possible conditions for which either one or the other is true
use the ____ characters between the elements.
(a)
&&
(b)
||
(c)
%=
(d)
!!
A more advanced function for sending data output to the browser is ______ .
(a)
Printit()
(b)
Sprintf()
(c)
Sendit()
(d)
Paintit()
© Copyright 2011 by P.E.P.
2
Download