05 Dec IT230-Assignment-2.docx Pg. 01 Question Three
IT230-Assignment-2.docx
|
Pg. 01 |
|
Question Three |
|
|
|
|
Assignment 2
Deadline: Thursday 19/11/2020 @ 23:59
[Total Mark for this Assignment is 6]
Web Technologies
IT230
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:
<?xml version=“1.0” encoding=“UTF-8”?>
<menu>
<Breakfast>
<item>
<name>Shakshuka</name>
<price>35 SAR</price>
<description> Farm eggs served over-easy in tomato-chili sauce oregano,feta,served with flatbread+home fries.</description>
</item>
<item>
<name>Steak n Eggs</name>
<price>45 SAR</price>
<description>Chicken-fried sirloin,rosemary garlic new potatoes,fried egg,Texas toast</description>
</item>
</Breakfast>
<Cafe>
<item>
<name>Espresso</name>
<price>10 SAR</price>
</item>
<item>
<name>Latte</name>
<price>12 SAR</price>
</item>
<item>
<name>Cappuccino</name>
<price>14 SAR</price>
</item>
</Cafe>
<Sides>
<item>
<name>Scrambled Eggs</name>
<price>15 SAR</price>
</item>
<item>
<name>Chips and Salsa</name>
<price>17 SAR</price>
</item>
<item>
<name>French Fries</name>
<price>10 SAR</price>
</item>
<item>
<name>Water</name>
<price>2 SAR</price>
</item>
</Sides>
</menu>
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:
<?php
function welcome()
{
if(date(“H”)<12)
{
return “have a good day”;
}
elseif(date(“H”)>=12)
{
return “have a good night”;
}
}
echo “Time:”.date(“h”);
echo “<br>”;
echo “Date:”.date(“Y-m-d”);
echo “<br>”;
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:
<?php
$courses = [“IT230”, “IT448”, “IT445”, “IT201”];
echo “I am a student at SEU in IT Department<br>”;
echo “I am studying in Fall2020 semester the following courses: <br>”;
echo “<br>”;
foreach ($courses as $item) {
echo “$item“.”<br>”;
}
?>
it230q2.xml
Shakshuka 35 SAR Farm eggs served over-easy in tomato-chili sauce oregano,feta,served with flatbread+home fries. Steak n Eggs 45 SAR Chicken-fried sirloin,rosemary garlic new potatoes,fried egg,Texas toast Espresso 10 SAR Latte 12 SAR Cappuccino 14 SAR Scrambled Eggs 15 SAR Chips and Salsa 17 SAR French Fries 10 SAR Water 2 SAR
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteEdu. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.
Do you need help with this question?
Get assignment help from WriteEdu.com Paper Writing Website and forget about your problems.
WriteEdu provides custom & cheap essay writing 100% original, plagiarism free essays, assignments & dissertations.
With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Chat with us today! We are always waiting to answer all your questions.