Exercises:: Assignment-1
Exercises:: Assignment-1
Exercises:: Assignment-1
Assignment-1
Exercises:
1. Definition: Create a webpage which provides the importance of “what is
computer science and engineering?" with use of all the text formatting tags,
heading tags, paragraph tags and horizontal row tag.
Code of file
<!DOCTYPE html>
<html>
<head>
<title>2171027_Ex.1</title>
</head>
<body bgcolor="#ece435">
<br>
<p><font face="comic sans ms" color="brown">One of the most sought after courses
amongst engineering students,<i> Computer Science Engineering (CSE)</i> is an academic
programme which integrates the field of Computer Engineering and Computer Science. The
programme, which emphasises the basics of computer programming and networking,
comprises a plethora of topics. The said topics are related to <sammp>computation,
IP-ASSIGNMENT 1(MID-SEM1) 1
SOUHARDYA SARKAR CS_2171027
<pre>1. UG (Undergraduate)
<h2>Analytical Skills</h2>
IP-ASSIGNMENT 1(MID-SEM1) 2
SOUHARDYA SARKAR CS_2171027
</body>
</html>
Screenshot of output
2. Definition: Mahi wants to create a webpage for ICT Branches & she wants to
add three branches as BDA, CBA & CS. Also, she wants to add dynamic links
as per given:
IP-ASSIGNMENT 1(MID-SEM1) 3
SOUHARDYA SARKAR CS_2171027
BDA: https://www.ict.gnu.ac.in/content/about-1
CBA: https://www.ict.gnu.ac.in/content/about
CS: https://www.ict.gnu.ac.in/content/about-course
Create a webpage as per given scenario & open every linked page in the
new tab.
Code of file
<!DOCTYPE html>
<html>
<head>
<title>2171027_Ex.2</title>
</head>
<body bgcolor="black">
<font size="5em">
</ol>
</body>
</html>
Screenshot of output
IP-ASSIGNMENT 1(MID-SEM1) 4
SOUHARDYA SARKAR CS_2171027
IP-ASSIGNMENT 1(MID-SEM1) 5
SOUHARDYA SARKAR CS_2171027
Image - 1
Image - 2 Image - 3
Code of file
<!DOCTYPE html>
<html>
<head>
<title>2171027_Ex.3</title>
</head>
<body>
<tr>
<td><img src="D:\Souhardya\Snapseed\PSX_20190517_213042.jpg"
height="350px" width="550px"></td>
<td><img src="D:\Souhardya\Snapseed\IMG_20190417_173854-01.jpeg"
height="350px" width="550px"></td>
<td><img src="D:\Souhardya\Snapseed\IMG_20190502_165810-01.jpeg"
height="350px" width="550px"></td>
</tr>
<tr>
IP-ASSIGNMENT 1(MID-SEM1) 6
SOUHARDYA SARKAR CS_2171027
<td><img src="D:\Souhardya\Snapseed\IMG_20190418_070117-03.jpg"
height="350px" width="550px"></td>
<td><img src="D:\Souhardya\Snapseed\IMG_20190228_134833-01.jpeg"
height="350px" width="550px"></td>
<td><img src="D:\Souhardya\Snapseed\IMG_20190217_122121-01.jpeg"
height="350px" width="550px"></td>
</tr>
<tr>
<td><img src="D:\Souhardya\Snapseed\IMG_20190217_122058-01.jpeg"
height="350px" width="550px"></td>
<td><img src="D:\Souhardya\Snapseed\IMG_20181216_121011-01.jpeg"
height="350px" width="550px"></td>
<td><img src="D:\Souhardya\Snapseed\IMG_20181230_130630-01.jpeg"
height="350px" width="550px"></td>
</tr>
</table>
</body>
</html>
Screenshot of output
IP-ASSIGNMENT 1(MID-SEM1) 7
SOUHARDYA SARKAR CS_2171027
4. Definition: Enlist the types of lists in HTML. Implement a HTML code for a
given nested list.
Code of file
<!DOCTYPE html>
<html>
<head>
<title>2171027_Ex.4</title>
</head>
<body>
<ul type="none">
IP-ASSIGNMENT 1(MID-SEM1) 8
SOUHARDYA SARKAR CS_2171027
<li>Verbs:</li>
<ol type="1">
<li>Conjugation</li>
<ol type="a">
<li>Present Tense</li>
<ol type="i">
<ol type="1">
<li>Regular</li>
<ol type="a">
<li>Exceptions</li>
<ol type="i">
<ol type="1">
</ol>
</ol>
</ol>
<li>Irregular</li>
IP-ASSIGNMENT 1(MID-SEM1) 9
SOUHARDYA SARKAR CS_2171027
<ol type="a">
<ol type="i">
</ol>
<li>Exceptions</li>
</ol>
</ol>
</ol>
<li>Past Tense</li>
<li>Present Continuous</li>
<li>Past Continuous</li>
<li>Future Tense</li>
<li>Far Past</li>
</ol>
</ol>
<li>Imperative</li>
</ul>
</body>
</html>
IP-ASSIGNMENT 1(MID-SEM1) 10
SOUHARDYA SARKAR CS_2171027
Screenshot of output
5. Definition: Differentiate between <td> & <th>. Implement a HTML code for
given table structure.
Make images clickable & your image will be redirect to the next page, which
shows the description as per following:
IP-ASSIGNMENT 1(MID-SEM1) 11
SOUHARDYA SARKAR CS_2171027
Code of file
<!DOCTYPE html>
<html>
<head>
<title>2171027_Ex.5</title>
</head>
<body>
<thead>
<tr>
</tr>
<tr align="center">
<th>Item Description</th>
<th>Price</th>
</tr>
<tr>
IP-ASSIGNMENT 1(MID-SEM1) 12
SOUHARDYA SARKAR CS_2171027
<th>Expense</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2">1.</td>
<td>$ 400.00</td>
</tr>
<tr>
<td>$ 20.00</td>
</tr>
<tr>
<td rowspan="2">2.</td>
<td>$ 50.00</td>
</tr>
<tr>
<td>$ 14.00</td>
</tr>
</tbody>
IP-ASSIGNMENT 1(MID-SEM1) 13
SOUHARDYA SARKAR CS_2171027
<tfoot>
<tr>
</tr>
</tfoot>
</table>
</body>
</html>
Code 5.1
<!DOCTYPE html>
<html>
<head>
<title>2171027_Ex.5.1</title>
</head>
<body>
<samp>colspan</samp><br>
Description:- This tag is used to merge cols in a particular row into a single row.
<br><br>
<samp>rowspan</samp><br>
Description:- This tag is used to merge rows in a particular column into a single column.
<br><br>
<samp>headers</samp><br>
Description:- This tag is used to define relation between one or more cell or header cells.
IP-ASSIGNMENT 1(MID-SEM1) 14
SOUHARDYA SARKAR CS_2171027
</samp>
</body>
</html>
Code 5.2
<!DOCTYPE html>
<html>
<head>
<title>2171027_Ex.5.2</title>
</head>
<body>
<thead><br>
Description:- This tag is used to define a table head section. It is of Importance when we have to
make a particular section of the Table displayed at the <big><b>TOP</b></big> of every content in the
table (just like a heading of a Chapter).
<br><br>
<tfoot><br>
Description:- This tag is used to define a table footer section. It is of Importance when we have to
make a particular section of the Table displayed at the <big><b>BOTTOM</b></big> of every content in
the table (just like a heading of a Chapter)
</samp>
</body>
</html>
IP-ASSIGNMENT 1(MID-SEM1) 15
SOUHARDYA SARKAR CS_2171027
Screenshot of output
IP-ASSIGNMENT 1(MID-SEM1) 16
SOUHARDYA SARKAR CS_2171027
6. Definition: Hypex.pvt.ltd wants to create form for their employees. Consider the
given details for “Employee Details” form & implement a HTML code for
the same. (Note: Add input fields in right column according to label of
left column)
Employee Details
Name
Contact No.
Gender
Address
Hobbies
Submit Cancel
Code of file
<!DOCTYPE html>
<html>
IP-ASSIGNMENT 1(MID-SEM1) 17
SOUHARDYA SARKAR CS_2171027
<head>
<title>2171027_Ex.6</title>
</head>
<body>
<form>
<tr>
</tr>
<tr>
</tr>
<tr>
<td><label id="email">Email</label></td>
</tr>
<tr>
</tr>
<tr>
<td><label id="gen">Gender</label></td>
</tr>
IP-ASSIGNMENT 1(MID-SEM1) 18
SOUHARDYA SARKAR CS_2171027
<tr>
<td><label id="city">City</label></td>
<td><select>
<option>select</option>
<option>Ahmedabad</option>
<option>Gandhinagar</option>
<option>Vadodara</option>
<option>Jamnagar</option>
<option>Rajkot</option>
<option>Bhavnagar</option>
<option>Porbandar</option>
<option>Mehsana</option>
<option>Dwarka</option>
<option>Bhuj</option>
</select></td>
</tr>
<tr>
<td><label id="add">Address</label></td>
</tr>
<tr>
<td><label id="hob">Hobbies</label></td>
</tr>
<tr>
IP-ASSIGNMENT 1(MID-SEM1) 19
SOUHARDYA SARKAR CS_2171027
<td><label id="pic">Photo</label></td>
</tr>
<tr>
</tr>
<tr>
</tr>
</table>
</form>
</body>
</html>
Screenshot of output
IP-ASSIGNMENT 1(MID-SEM1) 20
SOUHARDYA SARKAR CS_2171027
7. Definition: Create a mentioned structure using HTML frames & set target
according to following:
Target Area
Gray
Orange
Yellow
Code of file
<!DOCTYPE html>
<html>
<head>
<title>2171027_Ex.7</title>
</head>
<frameset cols="33%,*,33%">
<frameset rows="20%,*,20%,20%">
<frame src=""></frame>
<frame src=""></frame>
<frame src=""></frame>
<frame src=""></frame>
</frameset>
<frameset rows="20%,*,20%,20%">
<frame src=""></frame>
IP-ASSIGNMENT 1(MID-SEM1) 21
SOUHARDYA SARKAR CS_2171027
<frame src="a_7.1.html"></frame>
<frame src=""></frame>
<frame src=""></frame>
</frameset>
<frame name="demo"></frame>
</frameset>
</html>
Code 7.1
<!DOCTYPE html>
<html>
<head>
<title>2171027_Ex.7_1</title>
<style type="text/css">
body
font-size: 2.5em;
</style>
</head>
<body>
</body>
IP-ASSIGNMENT 1(MID-SEM1) 22
SOUHARDYA SARKAR CS_2171027
</html>
Code 7.1_grey
<!DOCTYPE html>
<html>
<head>
<title>2171027_Ex.7.1</title>
</head>
<body bgcolor="grey">
</body>
</html>
Code 7.1_orange
<!DOCTYPE html>
<html>
<head>
<title>2171027_Ex.7.2</title>
</head>
<body bgcolor="orange">
</body>
</html>
Code 7.3_yellow
<!DOCTYPE html>
<html>
<head>
IP-ASSIGNMENT 1(MID-SEM1) 23
SOUHARDYA SARKAR CS_2171027
<title>2171027_Ex.7.3</title>
</head>
<body bgcolor="yellow">
</body>
</html>
Screenshot of output
IP-ASSIGNMENT 1(MID-SEM1) 24
SOUHARDYA SARKAR CS_2171027
Name Description
Alert Box Opens a pop up box relaying urgent information which the
user must know
Confirm Box Opens a pop up box which asks the User to confirm the
data submission.
Prompt Box Opens a pop up box and asks for user data
Code of file
Code for Alert Box
<!DOCTYPE html>
<html>
<head>
<title>2171027_Ex.8</title>
<script type="text/javascript">
</script>
</head>
<body>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>2171027_Ex.8</title>
<script type="text/javascript">
</script>
</head>
<body>
IP-ASSIGNMENT 1(MID-SEM1) 26
SOUHARDYA SARKAR CS_2171027
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>2171027_Ex.8</title>
<script type="text/javascript">
prompt("Enter a Number: ");
</script>
</head>
<body>
</body>
</html>
Screenshot of output
IP-ASSIGNMENT 1(MID-SEM1) 27
SOUHARDYA SARKAR CS_2171027
9. Definition: Write a JavaScript code fir test() using number type parameter
which returns weather passed number is Armstrong or not.
IP-ASSIGNMENT 1(MID-SEM1) 28
SOUHARDYA SARKAR CS_2171027
Code of file
<!DOCTYPE html>
<html>
<head>
<title>2171027_Ex.9</title>
<script type="text/javascript">
function test(n)
{
var t=parseInt(n);
var sum=0;
while(t>0)
{
var a=t%10;
sum+=a*a*a;
t=t/10;
t=parseInt(t);
}
if(parseInt(sum)==parseInt(n))
document.write("It is an Armstrong Number");
else
document.write("It is not a Armstrong Number");
}
</script>
</head>
<body>
<script>
IP-ASSIGNMENT 1(MID-SEM1) 29
SOUHARDYA SARKAR CS_2171027
Screenshot of output
IP-ASSIGNMENT 1(MID-SEM1) 30