IT230 Assignment 2
Question Three
IT230 Web Technologies
College of Computing and Informatics
Question One
1 Marks
Learning Outcome(s):
Build web applications using PHP or similar languages.
What is a Servlet? What is the main job of HttpServletRequest and HttpServletResponse?
Answer:
What is a Servlet?
A servlet is a Java programming language class that is used in a request-response programming model to expand the functionality of servers accessed by host apps. Although servlets can respond to any form of request, they are typically used to extend web server hosted applications.
What is the main job of HttpServletRequest and HttpServletResponse?
A Servlet is a Java programming language class that is used to extend the functionality of servers accessed by host apps in a request-response programming model. Although servlets can respond to any type of request, they are usually used to expand applications hosted by the web server.
Question Two
2 Marks
Learning Outcome(s):
Write XML documents & XML Schema.
Convert the following Menu to XML document (it should be a well-formed XML document):
Answer:
Question Three
2 Marks
Learning Outcome(s):
Build web applications using PHP or similar languages.
Write a PHP code that displays the following output:
The program will print Have a good day if the time is less than 12 PM and will print have a good night if it is 12 or more.
Hint: date function in php is date();
Answer:
=12)
{
return “have a good night”;
}
}
echo “Time:”.date(“h”);
echo “
“;
echo “Date:”.date(“Y-m-d”);
echo “
“;
echo welcome();
?>
Question Four
1 Marks
Learning Outcome(s):
Build web applications using PHP or similar languages.
Write a PHP code that displays the following output. You must use arrays to display the course code. Note: You can change the courses based on what you are studying this semester. Hint: create an array, that has all of your courses, and use it to print the courses list.
Answer:
“;
echo “I am studying in Fall2020 semester the following courses:
“;
echo “
“;
f
Recent Comments