CSC 443 Midterm, Fall 2014
Lebanese American University · Web Programming · 5 pages
More CSC 443 files
Show the text of this exam
School af Apta & Selenaes
Department of Computer Science & Mathemation
Shi as so te CsC 440 Web Programing
4 Sy A Aad HH. Harianan
Lebanese American University Vall 2014
Midterm Examinatian
Name: Student [D)
Signature: —___ Diirations [TS irvlinvit ess |
General Instructions
A. There are 4 questions and 7 pages, Make gure that yo all of them
B. Exam questions are NOT sorted by arder of dill
and pace yourself accordingly, State any assy
unclear or missing
Conaicler ie [ealtibe Ol ta. | jhe Loti
uleed low o i
answer in the provided apace
1 Chat tia
C. Your answers should be brief and right to the point
only, No other spaces will be graded or even looked at
D. Your handwriting should be readable so it can be grace
E. You are liable to have pol
difficult to decipher!
F. The exam is o closed #Mik, closed 1 ced Qe own, Any allempts at
cheating or commu \ will leat! to expulsion from the exant
| fron your grade \f ya Hilwrithig ta exedsajwaly
Question | Points Soare
y =—— =
CSC 443: Midterm Examination
———_—_—_——_—_—_—————
(64) 1. Part I: Multiple Choice Questions [No Penalty!]
(a) All variables in PHP start with which symbol?
A. &
I
B..1 /
Os arr’
f
Pa
(b) What is = correct way to create a function in PHP?
‘AD function myFunction() i
B. newtunction myFunctjo
ton ()
C. create myFunction() oe
D. None of the above.
October 23. 2014
(c) If you set a cookie with either setcookie() or header(), you can immediately check to see whether
the client accepted it.
‘A) True, you can check the $_ COOKIE superglo
you set.
B. True, but only if register.globgls i is enab
C. False, you can only use setegokie() if
/™~ does not work. f
(,/Fatse, you must wait upfil you receive
it includes the Cookie header
B. You can no longer ssion data store afte
P headers.
D. Calling sessi auses the HTTP head
(e) Which of the followir tpresents to set
‘A) $.SESSION
‘B. session_start!
c
garbage’);
D. Sfoo = $.SESSION|'f
(f) A script is a
directly
~ pram
. Program oy
eptance. Usi
.o be sent.
ion variable?
. Session_set_save_h r ', @iPlose’, ‘myread'’, 'mywrite’,
y to see if it contains the value
eader()
equest to determine whether
has been output.
‘mydelete’, ‘my-
A. Program or sequence of instructions that is interpreted or carried out by processor
B. Program or a eee that is interpreted or carried out by another pro-
nce of instruction that is interpreted or carried out by web server
(gz) PHP is aw scripting Janguage that. is especially suited for web development
and can be en¥Yoedded into htm! ?
‘cy Open source general purpose
B. Proprietary general pose
C. Open source purpose
D. Proprietary special pu
(h) When compared to the compiléd program, scripts run
A. Faster
® Slayer
C. The ion speed is similar
Fall 2014
CSC 443: Midterm Examination
October 24, 2014
(1) Which of the following is not true?
A. PHP can be used develop web applications.
B. PHP makes a te dynamic,
veh PHP i can not be compiled.
at); PHP cannot be embedded into html.
(i) Which of the following mode of fopen() function opens a fle only for writing. If a file with that
name does not exist. attempts to create anew file. If the flgcxist place the file pointer at the
end of the file after all other data.
A. w
. See
D. a+
(k) The difference between include() and require()
A. are differemt how they handle failure
(B both are i) every Aspects
C. is include() prod a Fatal Error while require r
D. none of above
(1) When you need to obtay
na Warning
ASCIT value of a character which of the following function you
apply in PHP? &
A. chr( ); ~/
B. asc(); /
C. ord{ );
D) val );
(m) Which CSS tag is designed for a
A. <section>
B. / <span> -
se a
C. <division>
D. <div> ?
Web server retyw@e s cookie to a browser, the cookie will be included in al future
© the same server (True/False). Se
ts) alse
(o) Web browser Stateless: if a browser isn?t displaying a page for a particular server it need
not retain any state related to that server.
¢ to appear in « different font size or color?
1p
(p) In a scripting language, types are typically associated with values not variables. A
wee
COl-SPay- iS uALd te
— Ts ig
(7) 3. (6 points) Write an HTML form that is used
data should include the movie’
Format the form using CSS
sent to a PHP program t
to collect information
P movie was released,
Rt comes out white on a black form The data should be
accessed at http: » o>
nha
/ )
| “ -cablp: WHILE A
fs 4 been Bien ert: Ga » PLAC x. flow Cox 5
ae
o
hs het pf eee se tis Ca prelate ay, aa
Cl AMAT \ f
anes CS. Pectin
by, Salem /hy |
<r tal nding = \ bot?) eo
ld “iAPut Co pre “beel ” peg oA hn Value — (Wee
thers
far ~~ oS CCl ok
ab go Sh = Agee Lor. value — CRD tog
chines ge oe ae a wapuk Ps (tyes VN
a |
—_ ~ " le Phd potent
{Ss thi wesawes "uN LTT AAAS —— ea =
ai pan “PATE " growe = yuk
Y yt te. Tree cebsla | bpane A an Zz ipa ome ate =
viioc- te par”’ >
Fall Be ee eee