College of Computing and InformaticsAssignment 1
Deadline: Monday 02/01/2023 @ 23:59
[Total Mark for this Assignment is 8]
Student Details:
Name:
ID:
CRN:
Instructions:
• You must submit two separate copies (one Word file and one PDF file) using the Assignment Template on
Blackboard via the allocated folder. These files must not be in compressed format.
• It is your responsibility to check and make sure that you have uploaded both the correct files.
• Zero mark will be given if you try to bypass the SafeAssign (e.g., misspell words, remove spaces between
words, hide characters, use different character sets, convert text into image or languages other than English
or any kind of manipulation).
• Email submission will not be accepted.
• You are advised to make your work clear and well-presented. This includes filling your information on the cover
page.
• You must use this template, failing which will result in zero mark.
• You MUST show all your work, and text must not be converted into an image, unless specified otherwise by
the question.
• Late submission will result in ZERO mark.
• The work should be your own, copying from students or other resources will result in ZERO mark.
• Use Times New Roman font for all your answers.
Question One
Pg. 01
Learning
Outcome(s):
CLO1: Describe
methods and
tools in designing
a creative and
dynamic website.
Question One
2 Marks
Complete the following PHP script in the comments sections by assign your first name
to $firstName and second name to $secondName using string variables, then write the
PHP script output.
Answer:
Question Two
Pg. 03
Learning
Outcome(s):
Question Two
4 Marks
Based on the following table:
CLO1: Describe
methods and
tools in designing
a creative and
dynamic website.
Marks
90-100
80-89
70-79
60-69
Less than 60
Grade
A
B
C
D
F
a) Write a PHP script to identify a student grade. Your script must use switch
keyword, comparative and logical operators.
b) Write the script output that print the grade (i.e., A or B) based on the marks (e.g.,
$mark =80).
Answer:
Question Three
Pg. 04
Learning
Outcome(s):
CLO1: Describe
methods and
tools in designing
a creative and
dynamic website.
Question Three
2 Marks
Consider the setAge function which is written in PHP. What are the output of the
following PHP script.
Answer: