Sie sind auf Seite 1von 15

MOUNT KENYA UNIVERSITY

SCHOOL OF COMPUTING AND INFORMATICS

DEPARTMENT OF INFORMATION TECHNOLOGY

INTERNET PROGRAMMING

BIT3202

NAME:

ADM NO:
CAT 1 & CAT 2
CAT ONE

QUESTION ONE

Broman Traders International would like to design a website that will enable salesmen to enter
details of their sales.

(i) Design HTML form with features to enter Salesman number, Product number, Product
name, quantity and price then display total price. Include a method to send the details to
a PHP file called myProduct.php (5 marks)

SUGGESTED SOLUTION

<html>

<head>

<title> Bromans Traders International </title>

</head>

<body style="text-align:center;">

<h1 style="color: black;">Details</h1>

<form action="/myProduct.php" action="#" method="POST" target="_blank">

SalesMan Number: <input type="text" name="Salesman Number"value="Enter SalesMan


Number"> <br>

product number: <input type="text" name="pnumber" placeholder="Enter product number">


<br>

product name: <input type="text" name="pname" placeholder="Enter product name">

<br>

<label for="quantity">Quantity value between 10 and 50) :</label>

<input type="number" id="quantity" name="quantity" min="1" max="5"> <br>

<label class="col-form-label"> Estimated Amount</label>


<input type="text" class="form-control" name="estamount []" id="EstmTotal"
placeholder="Estimated Amount of Each">

<br>

<p>Amount: <span id="Amount"></span></p>

<br>

<input type="submit" value="Submit">

</form>

</body>

</html>

OUTPUT

(ii) Write a PHP code to receive the above details and calculate the total price and
commission which is offered according to products sold. A commission of 15% is
offered if the total sales is more than Kshs. 50,000, otherwise a commission of 5% is
offered. (5 marks)

SUGGESTED SOLUTION

<html>
<head>

<title> Bromans Traders International </title>

</head>

<body style="text-align:center;">

<h1 style="color:none;"> Details</h1>

<?php

if (isset($_POST['submitted'])) {

if ( is_numeric($qtySold) && is_numeric($price) ) {

echo '<h1>Commission</h1>';

if ($qtySold >= Ksh.50,000){

($commissionRate = 15%);

}else{

($commissionRate = 5%);

$commission = $total * $commissionRate;

echo "<p>Your commission is <b> $commission</b>.";

}else{

echo "Total sales is below ksh 50,000";}

?>

<form action="/myProduct.php" action="#" method="POST" target="_blank">

SalesMan Number: <input type="text" name="Salesman Number"placeholder="Enter SalesMan


Number">
<br> product number: <input type="text" name="pnumber"placeholder="Enter product
number">

<br>

product name: <input type="text" name="pname"placeholder="Enter product name">

<br>

<label for="quantity">Quantity value 1 and 5:</label>

<input type="number" id="quantity" name="quantity" min="1" max="5"> <br>

<label class="col-form-label"> Estimated Amount</label>

<input type="text" class="form-control" name="estamount[]" id="EstmTotal"


placeholder="Estimated Amount of Each">

<br>

<p>Amount: <span id="Amount"></span></p>

<br>

<input type="submit" value="Submit">

</form>

</body>

</html>

QUESTION ONE

When designing a website, planning is a key component in ensuring that a website meets the
objective of an organization. Outline the process of planning in website design (5 marks)

The website design process involves numerous number of process which include:

(i) Information Gathering- This is the first stage which involves gathering of
adequate information. This stage involves feasibility study, what the users want.
(ii) Planning – this is the second stage done after gathering the information. This is
done to ensure that everything is in the right place.
(iii) Design – This is the stage done to do the mockup of the website and ensure it has
the great design and user experience
(iv) Development- A programming language is used to write the lines of code for the
website
(v) Testing and delivery- After development, the website is then tested to ensure it is
free from bugs
(vi) Maintenance- After the website is tested for bugs and found to be free from bugs,
it’s now documented and maintained to keep up with the modern technology.

QUESTION ONE

Before 1990 Internet connection was expensive with only a few organizations in the developed
countries connected to the internet. Today internet is one of the most popular means of
communication and sharing information. Discuss the factors that have contributed to a
widespread use of internet (5 marks).

The following factors has led to the contribution to widespread of use of internet:

(i) IT infrastructure – This is one area which has evolved in the recent years. Different
inventions has been made in the field of Technology and this led the widespread use
of internet.
(ii) Government and Business Policies- How the government regulates its policies has led
to the widespread use of internet.
(iii) Degree of Urbanization- Due to digital error many people have migrated from the
rural area to the urban areas for the search of greener pastures which is internet.
(iv) Research- Because data requires network, this is a place which has led to widespread
use of internet
(v) Social Interactions- different people around the globe can communicate with each
other.

CAT TWO
SUGGESTED SOLUTION

<html>

<head>

<title>MKU Nairobi Campus Student Registration Portal</title>

</head>

<body>

<h3 align="center">MKU Nairobi Campus Student Registration Portal</h3>

<table align="center" cellpadding = "10">

<tr>

<td>FIRST NAME</td>

<td><input type="text" name="First_Name" maxlength="30"/>

</td>

</tr>

<tr>

<td>LAST NAME</td>

<td><input type="text" name="Last_Name" maxlength="30"/>

</td>

</tr>

<tr>

<td>DATE OF BIRTH</td>

<td>

<select name="Birthday_day" id="Birthday_Day">

<option value="-1">Day:</option>
<option value="1">1</option>

<option value="2">2</option>

</select>

<select id="Birthday_Month" name="Birthday_Month">

<option value="-1">Month:</option>

<option value="January">Jan</option>

<option value="February">Feb</option>

</select>

<select name="Birthday_Year" id="Birthday_Year">

<option value="-1">Year:</option>

<option value="2020">2020</option>

<option value="2019">2019</option>

<option value="2018">2018</option>

<option value="2017">2017</option>

<option value="2016">2016</option>

<option value="2015">2015</option>

<option value="2014">2014</option>

<option value="2013">2013</option>

</select>

</td>

</tr>
<tr>

<td>EMAIL ID</td>

<td><input type="text" name="Email_Id" maxlength="100" /></td>

</tr>

<tr>

<td>MOBILE NUMBER</td>

<td>

<input type="text" name="Mobile_Number" maxlength="10" />

(10 digit number)

</td>

</tr>

<tr>

<td>GENDER</td>

<td>

Male <input type="radio" name="Gender" value="Male" />

Female <input type="radio" name="Gender" value="Female" />

</td>

</tr>

<tr>

<td>ADDRESS <br /><br /><br /></td>

<td><textarea name="Address" rows="4" cols="30"></textarea></td>

</tr>

<tr>
<td>CITY</td>

<td><input type="text" name="City" maxlength="30" />

(max 30 characters a-z and A-Z)

</td>

</tr>

<tr>

<td>COUNTY</td>

<td>

<select name="County_day" id="County_Day">

<option value="-1">County:</option>

<option value="1">1</option>

<option value="2">2</option>

<option value="3">3</option>

<option value="4">4</option>

<option value="5">5</option>

<option value="6">6</option>

<option value="7">7</option>

<option value="8">8</option>

</select>

</td>

</tr>
<tr>

<td>COUNTRY</td>

<td><input type="text" name="Country" value="Kenya" readonly="readonly" /></td>

</tr>

<tr>

<td>HOBBIES <br /><br /><br /></td>

<td>

Drawing

<input type="checkbox" name="Hobby_Reading" value="Reading" />

Reading

<input type="checkbox" name="Hobby_Football" value="Football" />

Football

<input type="checkbox" name="Hobby_singing" value="Singing" />

Singing

<input type="checkbox" name="Hobby_Other" value="Other">

Others

<input type="text" name="Other_Hobby" maxlength="30" />

</td>

</tr>

<tr>

<td>QUALIFICATION <br /><br /><br /><br /><br /><br /><br /></td>

<td>

<table>
<tr>

<td align="center"><b>Sl.No.</b></td>

<td align="center"><b>Examination</b></td>

<td align="center"><b>Examination Body</b></td>

<td align="center"><b>Grade</b></td>

<td align="center"><b>Year of Passing</b></td>

</tr>

<tr>

<td>1</td>

<td>KCPE</td>

<td><input type="text" name="KCPE_Examination Body" maxlength="30" /></td>

<td><input type="text" name="KCPE_Grade" maxlength="30" /></td>

<td><input type="text" name="KCPE_Year Of Passing" maxlength="30" /></td>

</tr>

<tr>

<td>2</td>

<td>KCSE</td>

<td><input type="text" name="KCSE_Examination Body" maxlength="30" /></td>

<td><input type="text" name="KCSE_Grade" maxlength="30" /></td>

<td><input type="text" name="KCSE_Year Of Passing" maxlength="30" /></td>

</tr>

<tr>

<td>3</td>
<td>Undergraduate</td>

<td><input type="text" name="Undergraduate_Examination Body" maxlength="30" /></td>

<td><input type="text" name="Undergraduate_Grade" maxlength="30" /></td>

<td><input type="text" name="Undergraduate_Year Of Passing" maxlength="30" /></td>

</tr>

<tr>

<td>4</td>

<td>Masters</td>

<td><input type="text" name="Masters_Examination Body" maxlength="30" /></td>

<td><input type="text" name="Masters_Grade" maxlength="30" /></td>

<td><input type="text" name="Masters_Year Of Passing" maxlength="30" /></td>

</tr>

<tr>

<td></td>

<td></td>

</tr>

</table>

</td>

</tr>

<tr>

<td>COURSES<br />APPLIED FOR</td>

<td>

<input type="radio" name="Course_BCA" value="BCA">


BCA

<input type="radio" name="Course_BBIT" value="BBIT">

BBIT

<input type="radio" name="Course_BBM" value="BBM">

BBM

<input type="radio" name="Course_MEd" value="MEd">

MEd

<input type="radio" name="Course_BEDA" value="BEDA">

BEDA

</td>

</tr>

<tr>

<td colspan="2" align="center">

<input type="submit" value="Submit">

<input type="reset" value="Reset">

</td>

</tr>

</table>

</form>

</body>

</html>

OUTPUT
REFERENCES

Azasoo, J. (2018). Web Technologies and Internet Programming.

Beal, J., Pianini, D., & Viroli, M. (2015). Aggregate programming for the internet of
things. Computer, 48(9), 22-30.

Das könnte Ihnen auch gefallen