You are on page 1of 17

3270

Examination Answer Book

UNIVERSITY EXAMS 2021 / 2022


REGISTRATION NUMBER VU-BCS-1909-0032
Title of The Program (eg BBA, BSC, BPH, BSWA) BCS
Bachelor of Science in Computer Science
Department Other Depts in Faculty of Science and Technology
Faculty Faculty of Science and Technology
Year Of study (YrI , YrII, YrIII, or YrIV) YrII
Module Code and Name BCS228
Practical Project II Web appplication development
Semester Semester Two (II)
(Copy from the heading to the Examination Paper)
Retake: Yes ☐ No ☒ (Tick whichever is applicable)
Date of examination Sun Jul 25 2021 11:00:00 GMT+0300 (East Africa Time)

DIRECTIONS TO CANDIDATES (Turn to page FOR USE BY EXAMINERS ONLY


ii for more instructions). Question Internal External
1. Write your answers on ruled pages. Number Examiner Examiner
2. Use unruled pages for rough work. All rough
work must be done in the answer book and
crossed out.
Pages must not be removed from this answer
book.
3. Leave margin blank.
4. Begin each answer on a fresh page.
5. Write the number of each question and the
Candidate's Number at the top of each page.

6. Write the numbers of the questions which you


have attempted, with sub sections where
necessary, in the spaces provided below

TOTAL

NUMBER OF QUESTIONS you have answered in the order in which you have written them
5 3 1 2

Page |i @Victoria university Kampala Uganda P.T.O


VU-BCS-1909-0032
3270
How and where should I submit my examination script?
Every student will be required to attend their examination via VClass Students Portal E.g. you go to
www.vclass.ac and login, to your account, then on the left sidebar menu click on Examinations.
Under examinations you will see the following: -
a) Instructions for that particular examination with time required to finish your examination as
per instructions,
a) A student will be required to download the question paper and the answer sheet provided by
the university within the same module examination, or a student can be required to attempt
structured questions within the system depending on how the examination was set.
b) Submission of answered questions is done,
c) Student is required to click to consent to show that the answered exam belongs to them.
d) Note that if an examination is for download, a student will be required to download the
question paper and answer sheet, write their examination within the given stipulated time.
e) Required to scan and upload back the answered booklet through the same portal as per
format available.
f) Examinations uploaded will directly be received by the Registry department.
g) Students here are required to use VClass e-Learning system for all examinations and for any
failure they can contact the Registry department for guidance.
h) No late submission will be accepted.
Avoid any examination malpractice because this will attract severe penalties such as
invalidating the exams answered script whose consequences will attract retakes.

P a g e | ii @Victoria university Kampala Uganda P.T.O


VU-BCS-1909-0032
3270
Question Five
a) What are the software and hardware requirements for designing a good website?

Software such as a text editor, a virtual environment for you to work on, a web browser,
a virtual server running on your hardware such as apache.

Computer
Most modern desktops and laptops have the specifications to build a website.
The most significant computer parameter to check is the RAM size, which should be
greater than 2GB, though more is better.
Even with heavy apps like website editors or photo editors, the computer will function
quickly and smoothly as a result of this. The computer should have a keyboard and
mouse attached and working as well.

Internet
It is often necessary to have a high-speed Internet connection in order to establish a
website.
This enables you to upload the files that will make up your website to the online server
that will host it, make adjustments to your website, and view it live online to ensure that
it is functioning properly.

Server
To ensure that your website is always available for everyone wanting to access it, you'll
need a server computer to host it on.
While you can set up a computer to act as a web server, doing so is a difficult
undertaking, and purchasing a hosting package from a web hosting business is
significantly easier, more reliable, and cost-effective.
They'll look after and maintain the server's computing power.

b) In a bid to make your domain a destination online, what are the factors that will attract
people to visit your site?

Use effective search engine optimization techniques (SEO).


The use of an SEO is essential for attracting people to your online destination.You're
doing yourself a disservice if you don't grasp SEO now.Learn the complexities of SEO
so you can engage in the appropriate traffic delivery techniques.
You don't want to deviate from the guidelines in any way.Furthermore, if you truly
understand SEO, you can literally supercharge your results.

Create content that is passionate and creative.


In order to attract a large following to your website, it’s all about the content.You'll
keep readers coming back for more and more as long as you create ravenous content on
your website or blog.Your visitors will be more engaged if your material is good.
They will disseminate your material on your behalf, assisting in the automatic
promotion of your website.

Page |1 @Victoria university Kampala Uganda P.T.O


VU-BCS-1909-0032
3270
Make use of email marketing
Email marketing is a terrific method to attract visitors to your site or blog and advertise
any special deals, but it also necessitates the creation of a mailing list.
If you haven't already, create a lead magnet and a sales funnel to start building a list of
people to whom you can eventually promote (not spam) any of your offers.

On Instagram and other social media applications, get social.


Instagram is a well-known social media platform for sharing images and connecting
with people from all over the world.Few people, however, understand how to use
Instagram to increase traffic to their website. Many people, on the other hand, have
developed multimillion-dollar businesses purely through the use of Instagram as their
primary traffic source. The use of social media can better market your website and offer
great publicity and improved reach to the audience of your website.

Mobile Usability Is Prioritized


You want to be a more traffic to your site as possible. In order to do that make sure
your site is mobile-friendly. Check your mobile layout's friendliness and compliance
with requirements using Google's Page Insights tool. Make sure that all of your posts
and content are AMP-compatible.

CDNs and browser-caching tools should be used.


CDNs (Content-Delivery Networks) are an excellent technique to speed up page delivery
around the world.
The speed of your site and page content is something that Google and other search
engines are naturally worried about.
To use CDNs in conjunction with browser-caching technologies like W3 Total Cache
and WP Super Cache, use Amazon's AWS, MaxCDN, or any of the other options
available.

Google re-targeting advertisements are an excellent strategy to increase website visitors.


However, this isn't just any traffic.
Retargeting advertising target users who have already visited your site but left without
making a purchase for any reason.
This entails the use of a conversion pixel for purchases, and it's a terrific way to reach
out to folks who have already visited your site and promote to them aggressively.

Reference; https://www.forbes.com/sites/robertadams/2017/04/10/23-proven-ways-to-
drive-traffic-to-your-website/?sh=bca2c1426544.

c) Explain any two advantages and disadvantages of In-House and Out- sourced web
hosting.

Page |2 @Victoria university Kampala Uganda P.T.O


VU-BCS-1909-0032
3270
Advantages of the in-house web hosting
• You have complete control over website access, as well as the hardware you choose,
including the ease and expandability of updates.
• You also have control over the web server's operational environment, which includes
the software and systems that run on it.
• You'll be able to better control web storage and performance.
• You are not obligated to utilize a specific provider by contract or law.

Disadvantages of the in-house web hosting


• The price of purchasing your own web server hardware, software, and high-speed
internet access (typically using a dedicated connection).
• The technical abilities you or your team will need to build, manage, and improve the
website, as well as stay current with technological advances.
• Resources capable of providing website assistance 24 hours a day, 7 days a week to
ensure that it is available to users.
• The requirement for specialized security expertise in the use of tools and strategies to
keep your website secure.

Advantages of outsourcing

A company may decide to outsource a work, job, or process for a variety of reasons.
Outsourcing has a number of well-known advantages, for example:

• Improved emphasis on core business activities - Outsourcing allows your company to


concentrate on its strengths, allowing your employees to focus on their primary
responsibilities and the company's long-term strategy.
• enhanced efficiency - hiring an outsourcing company that specializes in the process or
service you need will help you get a more productive, efficient, and frequently higher-
quality service.
• cost control - cost savings from outsourcing can help you free up funds to invest in
other areas of your company.
• expanded reach – Outsourcing can provide you with access to capabilities and facilities
that would otherwise be inaccessible or unaffordable.
• increased competitive advantage - outsourcing can assist you in leveraging knowledge
and talents as well as your whole supply chain.

Outsourcing can also help your company become more flexible and adaptable, allowing
it to react to changing market conditions and problems while saving money and
improving service levels.

Disadvantages of outsourcing

Outsourcing is the process of giving a third party direct control over a corporate
function or process.
As a result, it entails some dangers.
When outsourcing, for example, you may run into issues with:

Page |3 @Victoria university Kampala Uganda P.T.O


VU-BCS-1909-0032
3270
• service delivery - which may be late or fall short of expectations.
• lack of flexibility - contract may be too tight to satisfy • confidentiality and security
may be jeopardized
• Management issues - changes at the outsourced firm could cause a rift.
• Unpredictability – the outsourced firm may go out of business.

References; https://www.nibusinessinfo.co.uk/content/pros-and-cons-house-hosting

Question Three
a) Explain the effect of the following four CSS style rules.

(i) h1 {text-align:center;}
This function is used to text align heading 1 to the center of the document. i.e. you center
heading 1.
(ii) body p b {color:orange;}
This sets the color of the body of p b to orange
(iii) h2.address {text-align:right; font-family:Arial;}
This aligns heading 2 to the right of the document and defines the font of that heading as
Arial.
(iv) table {border-style:dashed;}
This function makes the borders of the table appear in a dashed form.

b) What are the three levels at which CSS can be defined to specify the style of an
HTML5 document?
The three levels at which CSS can be defined to specify the style are INLINE CSS,
EXTERNAL CSS and INTERNAL or EMBEDDED CSS.
What HTML5 tags and attributes are used to accomplish this?

Inline CSS – an inline css uses the attribute ‘style ’ of an HTML element.

<!DOCTYPE html>
<html>
<body>

<h1 style="color:yellow;"> Understanding CSS </h1>

</body>
</html>

Page |4 @Victoria university Kampala Uganda P.T.O


VU-BCS-1909-0032
3270
This will make the heading “understanding css” yellow in color.

Internal or Embedded CSS – an internal CSS is defined in the <head> section of an


HTML page within a <style> element.

<!DOCTYPE html>
<html>
<head>
<style>
body {background-color: grey;}
h2 {color: black;}
p {color: blue;}
</style>
</head>
<body>

<h1>web application exam </h1>


<p> this is an example. </p>

</body>
</html>
This makes the background of the page grey, the heading black and the text in the
paragraph blue.

External CSS – this is an external stylesheet of its own used to define the style for
many HTML pages at a go. To use this, a link is added to it in the <head> section of
each html page.

<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="styles.css">
</head>
<body>

<h1>web app development exam</h1>


<p>This is an example .</p>

</body>
</html>

The style sheet

body {
  background-color: grey;
}
h1 {

Page |5 @Victoria university Kampala Uganda P.T.O


VU-BCS-1909-0032
3270
  color: black;
}
p{
  color: blue;
}

c) What is the relevance of CSS in web Application development?


CSS is a language for specifying the appearance of Web pages, such as colors,
layout, and fonts. It enables the presentation to be adapted to multiple types of
devices, such as huge displays, small screens, or printers. CSS is not dependent
on HTML and can be used in conjunction with any XML-based markup
language. The separation of HTML and CSS makes it easier to maintain
websites and share style sheets across several pages.
CSS is important because;
Improves Website Presentation - CSS's most notable benefit is the increased
design freedom and interactivity it provides in web development. Developers
have more control over the layout, allowing them to make fine-grained
modifications section by section. Web developers can generate multiple looks for
each page since CSS customization is easier than plain HTML. Complex
websites with pages that are presented in a unique way are possible.
Makes Updates Easier and Smoother - CSS is based on the creation of rules.
These rules are applied to several elements on the site at the same time. The
elimination of HTML's repetitive coding style makes development work more
efficient and less monotonous. Errors are also significantly reduced.
Because the content and the design are completely distinct, updates to the entire
website can be made at once. This cuts down on delivery times and expenses.
Helps Web Pages Load Faster - CSS's underappreciated but critical feature is
faster website loading. The CSS rules are downloaded once and cached so that
they can be used to load all of a website's pages. It speeds up website navigation
and improves the overall user experience. This feature is useful for ensuring that
websites run smoothly at slower internet rates. With faster loading times,
accessibility for low-end devices improves as well.

Question One
a) Suggest the appropriate name and subsequent domain of the site and a
hosting plan.
name- majpharm
Domain - .com
majpharm.com

Page |6 @Victoria university Kampala Uganda P.T.O


VU-BCS-1909-0032
3270
A suitable hosting plan for Mr. Maija’s pharmacy would be a dedicated
server hosting because he would need a server whose resources are entirely
under his control. And would be used to manage the large setup of his
website developed to manage branches across the whole of east and central
Africa.
b) what are the tools or languages you will use to develop the website?
A text editor
A virtual server like apache
Programming languages like PHP, JavaScript, python, HTML, MYSQL.
c) Conceptualize for him the website by illustrating the Layout of each pages,
the site navigation
HOME PAGE

PRODUCTS PAGE

ABOUT US AND SIGN UP PAGE

Page |7 @Victoria university Kampala Uganda P.T.O


VU-BCS-1909-0032
3270

and reasons why Mr. Maija should invest in the website.

Your competitor has a website.


The reason this is number one is that your competition is online while you
are not. You're losing sales to your competitors because they're more
available to the consumer if you're not online. If your competition, on the
other hand, does not have a website, having one makes you more available to
the consumer, providing you an opportunity to outperform them.

People WILL look you up on the internet.


People will search for your business online at some point in today's market.
Customers are looking for you, and if you're not online, how will they find
you? You're basically telling the consumer that you don't care about being
accessible to them if you don't have a website. Would you be able to manage
a company without a phone? You wouldn't do such a thing! So why take the
chance of not running it?

Your company operates 24 hours a day, seven days a week.


Your physical business location may only be open during certain hours and
days of the week. Customers can reach you 24 hours a day, seven days a
week if you have a website. Customers can reach you outside of normal
business hours if you have a website. If you sell real things, it gives people a
method to buy from you when they can't come in or when they can't come in
at all.

Websites are fantastic for promoting products and services.


Don't lower your website's budget when your advertising budget needs to be
cut. A good website gives you a variety of ways to reach out to your target
audience. You are able to advertise not only your products or services, but
also who you are and why people should buy from you. A website is similar
to a brochure in that it may be freely reproduced and interacted with.

Creating a positive image for your company


Your goal, whether you're a startup, a small firm, or a major corporation, is
to raise consumer awareness of your brand. You may instill trust in the

Page |8 @Victoria university Kampala Uganda P.T.O


VU-BCS-1909-0032
3270
consumer and appear larger than you are by investing in a well-designed
website. People expect you to have a website, and if you don't have one or it's
not up to par, you're tarnishing your reputation.

Increasing your revenue


If you don't have a website, you're missing out on a large piece of business,
whether you're selling real things or promoting your services. Investing in a
high-quality website will boost your revenues by allowing customers to see
your items or services in a more enticing way.

Getting feedback from your consumers


By incorporating forms, surveys, and quizzes into your website's technology,
you may transform it into a powerful marketing tool. In exchange, you
obtain vital insight into your clients' or consumers' desires, wishes, or overall
impressions of your products and services.

Gaining access to new target markets


You can reach certain target markets that you were previously unable to
reach and build your business by using the useful information gained from
having a website. You're no longer a tiny firm if you invest in a website! You
now have a huge chance of being viewed by millions of internet users all over
the world.

Creating passive income opportunities


Investing in a website is similar to hiring a dedicated salesperson for your
company. Customers can examine products, shop, place orders, and pay
their bills online if you have an online business. By doing so, you've
eliminated the back-and-forth of sales and made things easier for both you
and the customer. Your website might serve as a catalog for your business.

Question Two
a) Write an HTML5 script that will produce the above form.
b) Write a PHP code to create the table for Staff to store the information
from the above form.
c) Develop a PHP script to pick data from that form to the table created in c)
above.

Page |9 @Victoria university Kampala Uganda P.T.O


VU-BCS-1909-0032
3270
Index.html
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1,
shrink-to-fit=no">

<!-- Bootstrap CSS -->


<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.c
ss" integrity="sha384-
Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/
dAiS6JXm" crossorigin="anonymous">

<title>Hello, world!</title>
</head>
<body>
<div class="container mb-5 text-sm">
<div class="row">
<div class="col-6">
<h4>Personal Information</h4>
<form action="pi.php" method="POST">
<div class="form-group">
<label for="sname">Surname</label>
<input type="text" class="form-control" id="sname"
name="sname" placeholder="Surname">
</div>
<div class="form-group">
<label for="fname">Firstname</label>
<input type="text" class="form-control" id="fname"
name="fname" placeholder="Firstname">
</div>
<div class="form-group">
<label for="oname">Othername</label>
<input type="text" class="form-control" id="oname"
name="oname" placeholder="Othername">
</div>
<div class="form-group col-md-6">
<div class="form-check">
<input class="form-check-input" type="radio"
name="gender" id="male" value="M" checked>
<label class="form-check-label" for="male">
Male
</label>
</div>
<div class="form-check">

P a g e | 10 @Victoria university Kampala Uganda P.T.O


VU-BCS-1909-0032
3270
<input class="form-check-input" type="radio"
name="gender" id="female" value="F">
<label class="form-check-label" for="female">
Female
</label>
</div>
</div>
<div class="form-group">
<label class="mr-sm-2"
for="inlineFormCustomSelect">Marital Status</label>
<select class="custom-select mr-sm-2"
id="inlineFormCustomSelect" name="martialstatus">
<option selected>Choose...</option>
<option value="S">Single</option>
<option value="M">Married</option>
<option value="O">Other</option>
</select>
</div>
<div class="form-group">
<label for="dob">Date Of Birth</label>
<input type="text" class="form-control" id="dob"
name="dob" placeholder="Date Of Birth">
</div>
<div class="form-group">
<label for="pob">Place Of Birth</label>
<input type="text" class="form-control" id="pob"
name="pob" placeholder="Place Of Birth">
</div>
<div class="form-group">
<label for="mname">Mothername</label>
<input type="text" class="form-control" id="mname"
name="mname" placeholder="Mothername">
</div>
<div class="form-group">
<label for="faname">Fathername</label>
<input type="text" class="form-control" id="faname"
name="faname" placeholder="Fathername">
</div>
<div class="form-group">
<label for="nod">Number Of Descendants</label>
<input type="number" class="form-control" id="nod"
name="nod" placeholder="Number Of Descendants">
</div>
<div class="form-group">
<label for="loe">Level Of Eductation</label>
<input type="text" class="form-control" id="loe"
name="loe" placeholder="Level Of Eductation">
</div>

P a g e | 11 @Victoria university Kampala Uganda P.T.O


VU-BCS-1909-0032
3270
<button type="submit" class="btn btn-
primary">Save</button>
</form>
</div>
<div class="col-6">
<h4>Security Information</h4>
<form action="si.php" method="POST">
<div class="form-group">
<label for="uname">Username</label>
<input type="text" class="form-control" id="uname"
name="uname" placeholder="Username">
</div>
<div class="form-group">
<label for="pwd">Password</label>
<input type="password" class="form-control" id="pwd"
name="pwd" placeholder="Password">
</div>
<div class="form-group">
<label for="rpwd">Re-type Password</label>
<input type="password" class="form-control" id="rpwd"
name="rpwd" placeholder="Re-type Password">
</div>
<div class="form-group">
<label class="mr-sm-2" for="sq">Security Question</label>
<select class="custom-select mr-sm-2" id="sq" name="sq">
<option selected>Choose...</option>
<option value="A">Your Home District?</option>
<option value="B">Your Fathers Date of Birth?</option>
<option value="C">Favourite Movie</option>
</select>
</div>
<div class="form-group">
<label for="answer">Answer</label>
<input type="text" class="form-control" id="answer"
name="answer" placeholder="Answer">
</div>
<button type="submit" class="btn btn-
primary">Save</button>
</form>
</div>

</div>
</div>

<!-- Optional JavaScript -->


<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha384-

P a g e | 12 @Victoria university Kampala Uganda P.T.O


VU-BCS-1909-0032
3270
KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGF
F93hXpG5KkN" crossorigin="anonymous"></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min
.js" integrity="sha384-
ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXus
vfa0b4Q" crossorigin="anonymous"></script>
<script
src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
integrity="sha384-
JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76
PVCmYl" crossorigin="anonymous"></script>
</body>
</html>

Db.sql
CREATE DATABASE `exam-form`;
USE `exam-form`;

CREATE TABLE IF NOT EXISTS `personal_info` (


`id` int(11) NOT NULL AUTO_INCREMENT,
`surname` varchar(255) NOT NULL DEFAULT '0',
`firstname` varchar(255) NOT NULL DEFAULT '0',
`othername` varchar(255) NOT NULL DEFAULT '0',
`gender` enum('M','F') NOT NULL DEFAULT 'M',
`maritalstatus` enum('S','M','O') NOT NULL DEFAULT 'S',
`dob` varchar(255) NOT NULL DEFAULT '0',
`pob` varchar(255) NOT NULL DEFAULT '0',
`mothername` varchar(255) NOT NULL DEFAULT '0',
`fathername` varchar(255) NOT NULL DEFAULT '0',
`nod` int(11) NOT NULL DEFAULT '0',
`loe` varchar(255) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
);

CREATE TABLE IF NOT EXISTS `security_info` (


`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(255) NOT NULL DEFAULT '0',
`password` varchar(255) NOT NULL DEFAULT '0',
`sq` enum('A','B','C') NOT NULL DEFAULT 'A',
`answer` varchar(255) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
);

P a g e | 13 @Victoria university Kampala Uganda P.T.O


VU-BCS-1909-0032
3270
Si.php
<?php
$uname=$_POST["uname"];
$pwd=$_POST["pwd"];
$sq=$_POST["sq"];
$answer=$_POST["answer"];
//Database connection
$conn=new mysqli("localhost","root","","ex-form");
if ($conn->connect_error){
echo "Error";
die("Connection Failed:".$conn->connect_error);
}else{
$query=$conn->prepare("insert into
security_info(username,password,sq,answer)
values(?,?,?,?)");
$query->bind_param("ssss",$uname,$pwd,$sq,$answer);
$query->execute();
echo "Successfully Added";
$query->close();
$conn->close();
}
?>

Pi.php
<?php
$sname=$_POST["sname"];
$fname=$_POST["fname"];
$oname=$_POST["oname"];
$gender=$_POST["gender"];
$martialstatus=$_POST["martialstatus"];
$dob=$_POST["dob"];
$pob=$_POST["pob"];
$mname=$_POST["mname"];
$faname=$_POST["faname"];
$nod=$_POST["nod"];
$loe=$_POST["loe"];
//Database connection
$conn=new mysqli("localhost","root","","exam-form");
if ($conn->connect_error){
echo "Error";
die("Connection Failed:".$conn->connect_error);
}else{

P a g e | 14 @Victoria university Kampala Uganda P.T.O


VU-BCS-1909-0032
3270
$query=$conn->prepare("insert into
personal_info(surname,firstname,othername,gender,maritalstatus,dob,pob,
mothername,fathername,nod,loe)
values(?,?,?,?,?,?,?,?,?,?,?)");
$query->bind_param("sssssssssis",$sname,$fname,$oname,$gender,
$martialstatus,$dob,$pob,$mname,$faname,$nod,$loe);
$query->execute();
echo "Successfully Added";
$query->close();
$conn->close();
}
?>

P a g e | 15 @Victoria university Kampala Uganda P.T.O


VU-BCS-1909-0032

You might also like