Web Technology Slip 5

Q.1 Write a java script program to accept a number from user and check whether it is perfect number or not.

Answer : 

<html>
<head>
<script>
function saurabh()
{
var num,sum=0,i;
num = Number(document.getElementById("M").value);
for(i=1; i<num; i++)
{
if(num%i==0)
{
sum =sum+i;
}
}
if(num==sum)
{
alert(num+ "perfect number");
}
else
{
alert(num + "not perfect number");
}
}
</script>
</head>
<body>
<input id="M">
<button onclick="saurabh()">click</button>
</body>
</html>

Q.2 Write HTML code to design a website for Online Shopping. Design home page which consist of list of items each with hyperlink, clicking on which should display related information on separate web page. (Use external CSS to format each web page).


Answer : 


<html>
<head><title>E-Commerce Side</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body bgcolor="#f1f3f6">


<div id="two">
<table>
<tr>
<th width="12.5%">Electronics</th>
<th width="12.5%">TV & Appliences</th>
<th width="12.5%">Home & Furniture</th>
<th width="12.5%">Men</th>
<th width="12.5%">Woman</th>
<th width="12.5%">Baby & kids</th>
<th width="12.5%">Offiers</th>
<th width="12.5%">Sports,Books,and more</th>
</tr>
</table>
</div>


<br>
<img src="banner1.jpg" width="100%" height="46%">
<br>
<br>
<div id="three">
<table>
<tr><td colspan="5"><h2>SCHOOL BAGES</h2><hr></td></tr>

<tr>
<th><img src="bag2.jpg" width="75%"></th>
<th><img src="bag3.jpg" width="75%"></th>
<th><img src="bag4.jpg" width="75%"></th>
<th><img src="bag5.jpg" width="75%"></th>
<th><img src="bag2.jpg" width="75%"></th>
</tr>
<tr>
<td align="center"><font size="4" color="green">REDDIT</font></td>
<td align="center"><font size="4" color="green">LEGO</font></td>
<td align="center"><font size="4" color="green">CVZ</font></td>
<td align="center"><font size="4" color="green">NIKE</font></td>
<td align="center"><font size="4" color="green">ADIDAS</font></td>
</tr>
<tr>
<td align="center"><font size="4" color="green"> Price: INR 180/-</font> </td>
<td align="center"><font size="4" color="green"> Price: INR 550/-</font></td>
<td align="center"><font size="4" color="green"> Price: INR 475/-</font></td>
<td align="center"><font size="4" color="green"> Price: INR 350/-</font></td>
<td align="center"><font size="4" color="green"> Price: INR 250/-</font></td>
</tr>
<tr>
<td align="center"><a href="details.html"><input type="button" value="Details" style="width:150px; height:30px; background-color:blue; color:white;"></a></td>
<td align="center"><input type="button" value="Details" style="width:150px; height:30px; background-color:blue; color:white;"></td>
<td align="center"><input type="button" value="Details" style="width:150px; height:30px; background-color:blue; color:white;"></td>
<td align="center"><input type="button" value="Details" style="width:150px; height:30px; background-color:blue; color:white;"></td>
<td align="center"><a href="details.html"><input type="button" value="Details" style="width:150px; height:30px; background-color:blue; color:white;"></a></td>
</tr>
</table>
</div>


<div id="footer">copyright@2020 Design By Enter Your Name</div>
</body>

</html>


CSS


body{
font-family:Courier New;
}

#one > table {
border:0;
width:100%;
background-color:#2874f0;
height:8%;
}
#two > table {
border:0; 
width:100%; 
background-color:white;
height:8%;
}
#three > table {
border:0; 
width:100%; 
background-color:white;
}
#three > table >tr >tr >tr >tr{
width:150px;
height:30px; 
background-color:blue; 
color:white;
}

#footer{
clear:both;
padding:10px;
background-color:#999999;
color:white;
text-align:center;
background-image :url("HERO.gif");
padding-top:10px;
font-family:Courier New;
}



Web Technology Slip 5 Web Technology  Slip 5 Reviewed by technical_saurabh on December 21, 2020 Rating: 5

No comments:

Powered by Blogger.