Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
FIT2104 Sample Final Examination
Multiple Choice Questions
NOTE: There is only ONE correct answer for each question
If the user enters a value of 12 in the form, which ONE of the following will be displayed to the
user?
a. "123"
b. 123
c. 15
d. "15"
2. Which ONE of the following is the first function loaded from a Controller in CakePHP?
a. The function which is written first.
b. The index function.
c. The function the user calls via the browser.
d. None of the above
3. How many times will the following PHP for loop execute?
for ($i=6; $i<10; $i++)
{
$i=$i +1;
}
a. one
b. two
c. three
d. four
4. When processing a HTML form, which ONE of the following describes the difference between a
hidden form element and a visible form element?
a. There is no difference.
b. The hidden element does not have a value.
c. The hidden element's value cannot be retrieved
d. The hidden element is excluded from the HTTP request data
FIT2104 Sample Final Examination
Page 3 of 19
5. Which ONE of following variable assignments is 'by value' assignment in PHP ?
a. $value1= $value
b. $value1= &$value
c. $value1= *$value
d. None of the stated
6. Which ONE of the following CANNOT be used to decrement the value of $var by 1 in PHP?
a. $var--;
b. --$var;
c. $var=-1;
d. $var-=1;
7. Which ONE of the following is an invalid operator in PHP?
a. ===
b. +=
c. ==
d. +==
8. Which ONE of following variable assignments is 'by reference' assignment in PHP ?
a. $value1= $value
b. $value1= &$value
c. $value1= *$value
d. None of the stated
9. Which ONE of the following best describes CakePHP's preferred naming conventions?
a. Database table names plural, Model names singular, Controller names plural.
b. Model names plural, Database table names plural, Controller names plural.
c. Controller names plural, Database table names singular, Model names singular.
d. Controller names plural, Model names plural, Database table names singular.
10. If you set a cookie in PHP, using setcookie(), you can immediately check to see if the client
accepted it.
a. True, you can check the $_COOKIE superglobal array to see if it contains the value you set.
b. True, but only if register_globals is enabled.
c. False, you can only use setcookie() if you need to test for acceptance. Using header() does
not work.
d. False, you must wait until you receive another HTTP request to determine whether it
includes the Cookie collection
FIT2104 Sample Final Examination
Page 4 of 19
PART B
The Tables and PHP pages used in the following questions are described in
Appendices A, B, C & D.
Question 1. [6 marks]
Briefly explain the differences between the Waterfall and Agile methodologies with
regard to System development.
FIT2104 Sample Final Examination
Page 5 of 19
Question 2. [6 marks]
Identify and briefly describe the 3 different types of prototypes a developer may use
as part of their design approach.
FIT2104 Sample Final Examination
Page 6 of 19
Question 3. [6 marks]
Write the PHP code to complete the following function which displays the source
code of a PHP file, including line numbers and then counts the lines in the file and
outputs the number of lines to a web page.