Assignment No. 01
Semester: Fall 2011

IT430 E-Commerce

Total marks.20

Question 1:- (6+4)

a). Convert the following IP addresses to binary and vice versa.

i). 192.168.1.10

10.50.0.20

140.128.1.4

Answer:-

=11000000.10101000.1.1010

=1010.110010.0.10100

=10001100.10000000.1.1110

ii).10011011.10101011.00110101.11100101

11010101.11011011.11110101.10101111

11101111.10111011.10001101.11011111

Answer:-

=155.171.53.229

=213.219.245.175

=239.187.141.223

b).

Consider the following topology in which we have 5 computers from different network which are connected with each others through 7 routers i.e. R1, R2, R3, R4, R5, R6, and R7.Assume that computer “A” wants to send data to computer E what will be shortest path leading towards computer E? Also identify the other possible paths leading towards computer E.

Answer:-

The smallest way for sending data from Node A to Node E is R2,R6,R7 but the other possible way is R1,R4,R5 and R7.

Question 2: (10)

Write a program in HTML to create an online patient registration form. The patient registration form must contain information about patients that is to be admitted in the hospital. In the radio buttons Sex and Marital status only one must be selected at a time.

Your output should look like this:

Answer:-

html>

<head>

<title>PATIENT REGISTRATION FORM</title>

/head>

<body>

<p align=”center”<b<font size=”4″>PATIENT REGISTRATION FORM

</font</b</p>

<form method=”POST”>

<table border=”0″cellpadding=”5″cellspacing=”1″style=border-collapse:collapse”

bordercolour=”#111111″width=”100%”>

<tr>

<td width=”100%”>

<div align=”center”>

<center>

<table border=”0″ cellpadding=”0″ cellspacing=”0″ style=border-collapse :collapse” bordercolour=”#111111″ width=”650″

<tr>

<td width=”50″

<p align=”right”<b>Date:</b</td>

<td width=”200”>

<p align=”center”<input type=”text” name=”Date” size=”22”</td>

<td width=”15”&nbsp;</td>

<td width=”170”>

<p align=”right”<b>Patient control number:</b</td>

<td>

<p align=”center”<input type=”text” name=”pcn” size=”25”</td>

</tr>

</table>

</center>

</div>

</td>

</tr>

<tr>

<td width=”100%”<b<font size=”4”>PERSONAL INFORMATION</font</b</td>

</tr>

<tr>

<td width=”100%”>

table border=”0” cellpadding=”3” cellspacing=”1” style=border-collapse:collapse”

bordercolour=”#111111” width=”450”>

<tr>

<td width=”170”align=”right”<b>Name:</b</td>

<td width=”265”<input type=”text” name=”name” size=”30”</td>

</tr>

<tr>

<td width=”170”align=”right”<b>CNIC#:</b</td>

<td width=”265”<input type=”text” name=”CNIC” size=”30”</td>

</tr>

<tr>

<td width=”170”align=”right”<b>SEX:</b</td>

<td width=”265”<input type=”radio” value=”male” name=”gender” checked>Male

<input type=”radio” value=”gender” value=”female”>Female</td>

</tr>

<tr>

<td width=”170” align=”right”<b>Material status:</b</td>

<td width=”265”<input type=”radio” name=”status” value=”single”checked>Single

<input type=”radio” name=”status” value=”married”>Married</td>

</tr>

<tr>

<td width=”170” align=”right”<b<Father/Husband Name:</b</td>

<td width=”265”<input type=”text” name=”fhname” size=”30”</td>

</tr>

<tr>

<td width=”170” align=”right”<b<Date of birth:</b</td>

<td width=”265”<input type=”text” name=”dob” size=”30”</td>

</tr>

<tr>

<td width=”170” align=”right”<b>Phone:</b</td>

<td width=”265”<input type=”text” name=”phone” size=”30”</td>

</tr>

<tr>

<td width=”170” align=”right”<b>Address:</b</td>

<td width=”265”<input type=”text” name=”address” size=”30”</td>

</tr>

<tr>

<td width=”170” align=”right” align=”top”<b>Select Occupation:</b</td>

<td width=”265”>select size=”4” name=”occupation”multiple>

<option>Student</option>

<option>Advocate</option>

<option>Judiciary</option>

<option>Engineering</option>

<option>Business</option>

<option>Textile</option>

/select</td>

</tr>

</table>

</td>

</tr>

<tr>

td width=”100%”<b>font size=”4”INCREASE OF EMERGENCY</font</b</td>

</tr>

<tr>

<td width=”100%”>

<table border=”0″ cellpadding=”3″ cellspacing=”1″ style=border-collapse :collapse” bordercolour=”#111111″ width=”100″

<tr>

<td width=”30%” align=”right”<b>Name of person whom to contact:</td>

In case of emergency(not living at same address</b</td>

<td width=”70%”<input type=”text” name=”i.e _name” size=”30”</td>

</tr>

<tr>

<td width=”30%” align=”right”<b>Relationship with patient:</b</td>

<td width=”70%”<input type=”text” name=”r_patient” size=”30”</td>

</tr>

<tr>

<td width=”30%” align=”right”<b>Phone No:<b</td>

<td width=”70%”<input type=”text” name=”i.e_Phone” size=”30”</td>

</tr>

<tr>

<td width=”30%” align=”right”<b>Address:<b</td>

<td width=”70%”<input type=”text” name=”i.e_address” size=”30”</td>

</tr>

</table>

</td>

</tr>

</table>

<p align=”center”<input type=”submit” value=”Submit” name=”submit”<input type=”reset” value=”Reset” name=”reset”</p>

</form>

</body>

</html>