Sie sind auf Seite 1von 17

HOME WORK-2

WEB PROGRAMMING

Homework Title / No PART-1 & 2 Course Code: 1404

Course Instructor: Pr.Rishi Chopra Course Tutor (if applicable):

Date of Allotment: 15Sept, 2010. Date of submission: 21Sept, 2010.

Student’s Roll No.Rtb012A01 Section No. : Tb012.

Declaration:
I declare that this assignment is my individual work. I have not copied from any other
student’s work or from any other source except where due acknowledgment is made
explicitly in the text, nor has any part been written for me by another person.

Student’s Signature: Manoj


Sharma.

Evaluator’s comments:
_____________________________________________________________________

Marks obtained: ___________ out of ______________________

Part-A

Q.1 Write the code to create thumbnails and steps to create thumbnails using
appropriate Example.

<Html>

<Head>

<Title> thumbnail</title></head>
<bgcolor="red">
<a href="i1.html" target=" ">
<img src="i1.jpg" alt="" width="60" height="60"></a>
<a href="i2.html" target=" ">
<img src="i2.jpg" alt="" width="60" height="60"></a>

<a href="i3.html" target="">


<img src="i3.jpg" alt="" width="60" height="60"></a>

<a href="i4.html" target=" ">


<img src="i4.jpg" alt="" width="60" height="60"></a>

<a href="i5.html" target=" ">


<img src="i5.jpg" alt="" width="60" height="60"></a>
</html>
Target link:
For the I1.html
<html>
<head>
<title> thumbnail</title></head>
<img src="i1.jpg" border="1" width="900" height="500">
</html>
For I2.html
<html>
<head>
<title> thumbnail</title></head>
<img src="i2.jpg" border="1" width="900" height="500">
</html>
For I3.html
<html>
<head>
<title> thumbnail</title></head>
<img src="i3.jpg" border="1" width="900" height="500">
</html>
For I4.html
<html>
<head>
<title> thumbnail</title></head>
<img src="i4.jpg" border="1" width="900" height="500">
</html>
For Image4.html
For Image5 .html

<html>
<head>
<title> thumbnail</title></head>
<img src="image5.jpg" border="1" width="900" height="500">
</html>
Output:
Steps:
1. First save the picture as a JPEG file.

2. Access the HTML source code for the page you want to add a
thumbnail to.
3. Type in the following HTML code, replacing the words
"pictureURL" with the exact URL of the picture you are using:
<a href="image1.html" target=" ">
<img src="image1.jpg" alt="" width="60" height="60"></a>

4. Save the page and view it to see your new thumbnail image and
associated full-sized picture link. The thumbnail will be 60 pixels
by 60 pixels using the code in Step 4; if you want a different-sized
thumbnail, simply fill in different values under the width and
height sections of the code.

Q.2 Write a code for the following web page:

Lists

 -----------------------------
 -----------------------------
 ------------------------------
1. -----------------------
2. -----------------------
3. -----------------------
I……………………….

II………………………

III………………………

a)……………………………..

b)…………………………….
Answer:

<html>
<body>
<h1 >Lists</h1>
<ul>
<li>------------</li>
<li>-------------</li>
<li>-------------</li>
<ol type = "1">
<li>----------</li>
<li>----------</li>
<li>----------</li>
<ol type = "I">
<li>...........</li>
<li>...........</li>
<li>...........</li>
<ol type = "a">
<li>...........</li>
<li>...........</li>
<li>...........</li>
</ol>
</ol>
</ol>
</ul>
</body>
</html>

Q.3 Write HTML code for following layout using frames. The underlined words act as hyperlink and
correspond to each hyperlink the appropriate page should be open.

Lovely Professional University

 Courses Courses

 Schools

 Dept

 Blocks

Answer:

Frame coding:

<html>

<head>

<title>webpage</title></head>

<frameset rows="20%,*">

<frame src="LPU.html">
<frameset cols="20%,*,*">

<frame src="link.html">

<frame name="frame">

</frameset>

</frameset>

</HTML>

Output:
Linking coding.

<html>

<head>

<title>webpage</title></head>

<body>

<a href="courses.html" target="frame">Courses</a><br>

<a href="schools.html" target="frame">Schools</a><br>

<a href="dept.html" target="frame">Dept</a><br>

<a href="blocks.html"target="frame">Blocks</a>

</body>

</html>

Courses coding:

<html>

<head>

<title>webpage</title></head>

<body bgcolor="yellow">

<p><font color="red"><h1>Courses</h1></p></font>

LPU offer courses:-


Management<br>

Hotel Management,<br>

Computer Application,<br>

Engineering,<br>

Architecture, <br>

Design, <br>

Commerce, <br>

Fashion Technology,<br>

Pharmacy, <br>

Physiotherapy, <br>

Paramedical Sciences, <br>

Biotechnology,<br>

Microbiology,<br>

Biochemistry, <br>

Education, <br>

Physical Education,<br>

Films, Animation, Fine Arts, Performing Arts, Sciences, Arts & Languages
etc.

</body>

</html>
Out put:

Schools coding:

<html>

<head>

<title>webpage</title></head>

<body bgcolor="yellow">

<p><font color="red"><h1>Schools<h1></p></font>

<h1>Lovely School of Technology </h1>

<h1> Lovely School of Management </h1>

<h1> Lovely School of Engineering </h1>


</body>

</html>

Output:

Dept coding

<html>
<head>

<title>webpage</title></head>

<body bgcolor="yellow">

<p><font color="red">Dept</p></font>

</body>

</html>
Blocks coding:

<html>

<head>

<title>webpage</title></head>

<body bgcolor="yellow">

<p><font color="red"><h1>Blocks</h1></p></font>

<h2>BH Block-1</h2>

<h2>BH Block-2</h2>

<h2>BH Block-3</h2>

</body>

</html>

Part-B
Q.4 Write code for a Web page which uses CSS to display relevant data.

Answer: </html>

<style type="text /css">

body{background-color: red;}

h1 {color: blue; text-align: enter;}

P {font-family:” Arial";

font-size:30px;

</style>

</head>

<body>

<h2> <font color="Yellow">System software </h2></font>

<p> System software is computer software designed to operate the


computer hardware and to provide and maintain a platform for running
application software.<br>

System software helps use the operating system and computer system.
It includes diagnostic tools, compilers, servers, windowing systems,
utilities, language translator, data communication programs, database
systems and more.

</p>
</body>

</html>

Output:

Q.5. Write code for a Web page which uses JavaScript to perform
various validations on the registration form for an organization.

<html>
<head>
<title>Login</title>
<script type="text/javascript">
function validate(form){
var userName = form.Username.value;
var password = form.Password.value;
if (userName.length ===0) {
alert("You must enter a username.");
return false;
}

if (password.length == 0) {
alert("You must enter a password.");
return false;
}

return true;
}
</script>
</head>
<body>
<h1>Login Form</h1>
<form method="post" action="registration.html"
onsubmit="return validate(this);">

Username: <input type="text" name="Username" size="10"><br/>


Password: <input type="password" name="Password"
size="10"><br/>

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


<input type="reset" value="Reset Form">
</p>
</form>
</body>
</html>
Out put:

Q.6 Create a HTML form that calculates electricity bill, maybe user ought
to have the option of online payment. Use JavaScript to perform
relevant validations for a given below.

<html>

<head>

<title> my electricity web page</title></head>

<body>

<form name="Electricityform">

<h1><u>Electricity billing form</u></h1>

<pre>

Monthly Utility Bill : <input type="text" name="billVal">

Annual Inflation (%) : <input type="text" name="infRate" value = "2">

Calculate for Years : <input type="text" name="years">


<input type="button" name="calc" value=" Calculate Savings "
onclick="calculate Win(myform1)">

Total Energy Cost : <input type="text" name="totalexpense">

</pre>

</form>

</body>

</html>

Das könnte Ihnen auch gefallen