You are on page 1of 31

SLIP 1

Q1. Execute the following commands. Also write its use.


a) Ping
use-ping command is used to check connectivity between two nodes
command-hostname -i;
ping ip_address;
b) Who
use-It displays
1)login name of the users
2)Terminal line numbers
3)Login time of the users
4)Remote hostname of the user
command-who
c) hostname
use-It displays ip address of the hostname
establishes all configured networks interfaces and shows all network address of
host
command-hostname -i;
hostname -I;
d) Traceroute
use-It is used to determine the path along which a packet travels
command-traceroute google.com
e) Netstat
use-it is used to display routing table,connection information,the status of of
ports
command-netsat;

Q2.Write the HTML code to display list of any three car companies. For each
company
display list car models as ordered list. Display car model as hyperlink. On click
of car
model it should display an image of that car in another window.
(Create separate HTML page for each car model which will display an image.)
ans-
<html>
<body>
<h1>MODELS OF CARS</h1>
<li><a href="T.html"> TESLA MODEL</a></li>
<li><a href="F.html"> FERRAIE MODEL</a></li>
<li><a href="P.html"> FORTUNER MODEL</a></li>
</body>
</html>

<html>
<head>
<title>FORTUNER</title>
<h1><b><big><center>FORTUNER MODEL</center></h1></b></big>
<body>
<center>
<img src="/home/mitacsc/Pictures/fortuner.jpeg">
</center>
</body>
</html>

<html>
<head>
<title>TESLA</title>
<h1><b><big><center>FERRARI MODEL</center></h1></b></big>
<body>
<center>
<img src="/home/mitacsc/Pictures/ferrri.jpeg">
</center>
</body>
</html>
OR

Q2. Write a JavaScript program for accepting name and mobile number from user and
perform following validation:
[20 Marks]
a) Check all fields should not contain a null value
b) Check name field contains only alphabets
c) Mobile No. field should be of 10 digits long.

<html>
<head>
<title>name & mobile number validation</title>
<script>
function formvalidation()
{
var uname=document.form1.uname;
var num=document.form1.unum;
if(username(uname))
{
if(mobileNo(num))
{
}
}
}

function mobileNo(unum)
{
var numbers=/^[0-9]+$/;
if(unum.value.match(numbers))
{
return true;
}
else
{
alert('Mobile number should be numerisc');
unum.focus();
return false;
}
}

function username(uname)
{
var letters=/^[A-Za-z]+$/;
if(uname.value.match(letters))
{
return true;
}
else
{
alert('Username must hae alpabet charecters only');
uname.focus();
return false;
}
}
</script>
</head>
<body onload="document.form1.uname.focus();">
<form name="form1" onSubmit="return formvalidation();">
Name: <input type="text" id="uname" /><br>
Mobile: <input type="number" id="unum"/><br>
<input type="submit" name="submit" value="submit"/>
</body>
</html>

SLIP 2
Q1. Write HTML code to display the rainbow color names using Ordered List. Modify
the
code to display each color name with the same color of rainbow using font tag.
Apply
page background color as black.
ANS-
<html>
<head><title>SET A</title></head>
<body bgcolor="black">
<h1><center> <font color="white"> RAINBOW COLOURS</h1></center></font>
<font size=6 color=red><li>Red</li></font>
<font size=6 color=orange><li>Orange</li></font>
<font size=6 color=yellow><li>Yellow</li></font>
<font size=6 color=green><li>Green</li></font>
<font size=6 color=blue><li>Blue</li></font>
<font size=6 color=indigo><li>indigo</li></font>
<font size=6 color=violet><li>Violet</li></font>
</body>
Q2. Write HTML code to generate the following output:
ans-

<html>
<head>
<title>
TABLE
</title>
</head>
<frameset rows="10%,80%,10%">
<frame src="h.html"/>
<frameset cols="20%,80%">
<frame src="i.html"/>
<frame src="k.html"/>
</frameset>
<frame src="footer.html"/>
</frameset>
</html>

OR
Q2. Write a JavaScript code to calculate maximum, minimum, sum and average of
numbers
in an array.

<html>
<body>
<script>

var array=new Array();


var max;
var sum=0;
var size=parseInt(prompt("enter the size of the array"));
for(var i=0;i<size;i++){
array[i]=parseInt(prompt("enter number in the array"));
}
max=array[0];
for(var i=0;i<size;i++){
if(max<array[i+1]){
max=array[i+1];
}
}
var min=array[0];
for(var i=0;i<size;i++){
sum=sum+array[i];
if(min>array[i+1]){
min=array[i+1];
}
}

document.writeln("max="+max);
document.writeln("min="+min);
document.writeln("sum="+sum);
var avg=sum/size;
document.writeln("average="+avg);

</script>
</body>
</html>

SLIP 3
Q1. Write HTML code for the following:
a) Display following polynomial expression:
15X 4 + 9X 3 + 4X 2 + 2X + 4 = 0
Display coefficient in Bold.
ans-
<html>
<head>
<title>Polynomial Expression</title>
<style>
.coefficient {
font-weight: bold;
}
</style>
</head>
<body>
<p><span class= "coefficient">15</span>x<sup>4</sup> + <span class=
"coefficient">9</span>x<sup>3</sup> + <span class=
"coefficient">4</span>x<sup>2</sup> + <span class= "coefficient"> 2x + 4 </span> =
0</p>
</body>
</html>
b) Display the text message as “S.Y.B.C.A. (Science)” at center with different
heading
styles in different colors.
ans-
<html>
<head>
<title>Heading Styles</title>
<style>
.red {
color: red;
}
.green {
color: green;
}
.blue {
color: blue;
}
.center {
text-align: center;
}
</style>
</head>
<body>
<h1 class= "red center">S.Y.B.C.A.(Science)</h1>
<h2 class= "green center">S.Y.B.C.A.(Science)</h2>
<h3 class= "blue center">S.Y.B.C.A.(Science)</h3>
</body>
</html>
Q2. Write HTML code to divide the frame into different sections as shown below and
add
appropriate html files to each frame.
ans-
<html>
<body>
<h1><center> First name:Sayali Sandip Pathare A/P Kalus <h1></center>
</body>
</html>

<html>
<body>
<h1> Favourite sites<h1>
<ol type="square">
<li>
<a href="https://www.google.com">Google</a>
</li>
<li>
<a href="https://www.brainscape.com">Brainscope</a>
</li>
<li>
<a href="https://www. bigthink.com">Big Think</a>
</li>
</ol>
</body>
</html>

<html>
<head>
<title>
HTML
</title>
</head>
<frameset rows="5%,5%,5%"/>
<frame src="1.html"/>
<frameset cols="50%,50%">
<frame src="2.html"/>
<frame src="3.html"/>
</frameset>
<frameset cols="30%,30%,40%">
<frame src="4.html"/>
<frame src="5.html"/>
<frame src="6.html"/>
</frameset>
</html>
OR
Q2. Write a JavaScript program to display a Multiplication table in tabular format
using
function.

<html>
<body>
<script>
var num=parseInt(prompt("Enter the number"));
for(var i=1;i<=10;i++){
document.writeln(num+"*"+i+"="+num*i+"<br>");
}
</script>
</body>
</html>
SLIP 4
Q.1. Create HTML page with following specifications
a) Title should be about myCity
b) Place your City name at the top of the page in large text and in blue color
c) Add names of landmarks in your city each in a different color, style and
typefaced.
d) One of the landmark, your college name should be blinking.
e) Add scrolling text with a message of your choice.

Q2. Write HTML code to generate the following output:


ans-
<html>
<head>
<title>feedback form</title>
</head>
<body bgcolor="pink">
<center>
<h2><b>Feedback form</b></h2><br>
<form>
Student Name <input type="text" name="name"></input><br><br><br>
Student Email<input type="text" name="name"></input><br><br><br>
How do you know this institute<select name="mode" id="mode">
<option value="online">online</option>
<option value="friend">friend</option>
<option value="family and relatives">family and relatives</option>
<option value="other">other</option>
</select><br><br><br>
<input type="radio" name="rating" value="poor">Poor</input>
<input type="radio" name="rating" value="good">Good</input>
<input type="radio" name="rating" value="very good">Very Good</input>
<input type="radio" name="rating" value="excellent">Excellent</input>
<br>
Suggestions for the betterment of faculty and institute
<br><textarea name="comment" rows="10" colse="40"></textarea><br><br>
<input type="submit" value="send"></input>
<input type="reset" value="clear"></input>
</form>
</body>
</html>

OR
Q2. Write a JavaScript function to validate email-id using regular expression. [20
Marks]

<html>
<body>
<div style="border:1px solid #cccccc;">
This is the first text
</div>
<div style="border:2px solid red;">
This is box 1
</div>
<div style="border:2px solid green;">
This is box 2
</div>
<div>
This is the last text
</div>
</body>
</html>

SLIP 5
Q1. Create HTML page with all the different text styles (bold, italic and
underlined) and its
combinations onseparate lines. State style of each line in its text.
ans-

Q2. Write HTML code to generate the following output:


ans-
<html>
<head>
<title>OS for use form</title>
</head>
<form>
Enter your name <input type="text" name="name"></input><br><br><br>
Enter your password <input type="text" name="name"></input><br><br><br>
Which operating system have you used?<br>
<input type="checkbox" name="LINUX" value="linux">LINUX</input>
<input type="checkbox" name="Windows XP" value="Windows XP">Windows XP</input>
<input type="checkbox" name="Macintosh 8.0" value="Macintosh 8.0">Macintosh
8.0</input><br>
Which operating system do you like the best?<br>
<input type="radio" name="LINUX" value="linux">LINUX</input>
<input type="radio" name="Windows XP" value="Windows XP">Windows XP</input>
<input type="radio" name="Macintosh 8.0" value="Macintosh 8.0">Macintosh
8.0</input><br>
You have completed the form.
<input type="submit" value="submit"></input>
</form>
</html>

OR
Q2. Write a JavaScript program to print the reverse of a number. [20 Marks]

<html>
<head>
<title>Reverse of number</title>
</head>
<body>
<script>

let num=prompt("Enter the number");


let rev=0,rem=0;
while(num>0){
rem=num%10;
rev=rev*10+rem;
num=parseInt(num/10);

}
alert(rev);

</script>
</body>
</html>

SLIP 6
Q1 Create HTML page with following specifications:
a) The Background colour should be green.
b) The text colour should be red.
c) The heading should be large in size as ‘My Assignment’.
d) Display a horizontal line after heading.
e) Display your name in Bold, address in Italics and year as S.Y
Q2. Write HTML code to generate the following output:
ANS-
<html>
<head>
<title>OS for use form</title>
</head>
<form>
Enter your name <input type="text" name="name"></input><br><br><br>
Enter your password <input type="text" name="name"></input><br><br><br>
Which operating system have you used?<br>
<input type="checkbox" name="LINUX" value="linux">LINUX</input>
<input type="checkbox" name="Windows XP" value="Windows XP">Windows XP</input>
<input type="checkbox" name="Macintosh 8.0" value="Macintosh 8.0">Macintosh
8.0</input><br>
Which operating system do you like the best?<br>
<input type="radio" name="LINUX" value="linux">LINUX</input>
<input type="radio" name="Windows XP" value="Windows XP">Windows XP</input>
<input type="radio" name="Macintosh 8.0" value="Macintosh 8.0">Macintosh
8.0</input><br>
You have completed the form.
<input type="submit" value="submit"></input>
</form>
</html>

OR
Q2. Write a JavaScript program to accept a number from user and display that number
in
words (e.g. 226 Two Two Six)

<html>
<head>
<title>Number in words</title>
</head>
<body>
<script>
var number=parseInt(prompt('Enter the number:'));
let rev=0,rem=0;
while(number>0){
rem=number%10;
rev=rev*10+rem;
number=parseInt(number/10);
}

while(rev>0){
let rem=rev%10;
switch(rem)
{
case 1:document.write("One ");
console.log('One');
break;
case 2: document.write("Two ");
break;
case 3: document.write("Three ");
break;
case 4: document.write("Four ");
break;
case 5: document.write("Five ");
break;
case 6: document.write("Six ");
break;
case 7: document.write("Seven ");
break;
case 8: document.write("Eight ");
break;
case 9: document.write("Nine ");
break;
}
rev=parseInt(rev/10);
}
</script>
</body>
</html>

SLIP 7
Q1. Write HTML script with internal CSS to display following screen:
<html>
<body>
<div style="border:1px solid #cccccc;">
This is the first text
</div>
<div style="border:2px solid red;">
This is box 1
</div>
<div style="border:2px solid green;">
This is box 2
</div>
<div>
This is the last text
</div>
</body>
</html>

Q2. Write HTML script to generate following screen:


(On clinking on the hyperlink, display separate HTML page)
[
OR
Q2. Write a JavaScript program to print factorial of a given number. [20 Marks]

<html>
<head>
<title>factorial of a number</title>
</head>
<body>
<script>
var num=prompt("Enter a number");
var fact=1;
if(num==0||num==1)
{
alert(fact);
}
else if(num>1){
for(var i=1;i<=num;i++){
fact*=i;
}
alert(fact);
}
</script>
</body>
</html>
SLIP 8
Q.1 Execute the following commands. Also write its use.
a) Netstat
use-it is used to display routing table,connection information,the status of of
ports
command-netsat;
b) nmap
use-it produce information about the given host
command-nmap ip_address
c) nslookup
use-This command queriea used to fetch ip_address or domain name from dns record
command-nslookup facebook.com
d) Ping
se-ping command is used to check connectivity between two nodes
command-hostname -i;
ping ip_address;
e) Who
use-It displays
1)login name of the users
2)Terminal line numbers
3)Login time of the users
4)Remote hostname of the user
command-who

Q2. Write HTML code to generate the following output and display each element of
list in different size, color & font. Use internal CSS to format the list.
[20 Marks]
OR
Q2. Write a JavaScript program to compare the values of password and confirmed
password
field and display message accordingly. Also perform the validation to check any of
the
field should not be empty.

<html>
<body>
<h1>User login</h1>
<form name="login_form">
username:<input type="text" name="username" style="margin-left: 60px;"></input><br>
password:<input type="password" name="password" style="margin-left:
60px;"></input><br>
confirm password<input type="password" name="confirm_password"></input><br>
<button type="button" onclick="validate();" style="height: 27px;
width: 50px;">submit</button>
</form>
<script>

function validate(){
var username=document.login_form.username.value;
var password=document.login_form.password.value;
var confirm_password=document.login_form.confirm_password.value;
if(username==""||password==""||confirm_password==""){
alert("empty fields");
}
else if(password!=confirm_password){
alert("confirm passwrod n=does nit match");
}
else{
alert("login sucessful");
}
}

</script>
</body>

</html>

SLIP 9
Q1. Write HTML code to generate the following output:
[
SYBCA (Science) Subjects
ANS)
<html>
<head>
<title>SYBCA</title>
</head>
<h1><b><big><center>SYBCA(Science) Course Objectives </h1></b></big>
<body>
<ol>
<li>Data Structurs</li>
<ul type="circle">
<li>To understand algorithms and analysis of algorithms</li>
<li>To learn static and dynamic data structures</li>
</ul>

<li>Database Management System2</li>


<ul type="disc">
<li>To understand advanced SQL features and procedural SQL</li>
<li>To study concurrency control and crash recovery techniques</li>
</ul>
<li>Computer Networks</li>
<ul type="square">
<li>To learn role of proyocols at various layers in th eprotocol stacks</li>
<li>To study different techniques for framing error control,flow control and
routing</li>
</ul>
</ol>
</body>
</html>
Q2. Create HTML page giving information about celebrating Dussehra in your country.
Use various tags in HTML to give it a pleasant look. It should be having following
links. Create separate HTML page for each link and display the respective
information.
a) Information why it is celebrated
b) When it is celebrated
[20 Marks]
c) What you do on this day
ans)<html>
<head>
<title> DUSSHERA </title>
</head>
<body>
<center>
<h1>DUSSHERA </h1>
<img src="/home/mitacsc/Pictures/Dusshreara.jpg" width="400"
height="400"></img></center>
<a href="https://www.google.com/imgres?imgurl=https%3A%2F%2Fwww.bankbazaar.com
%2Fimages%2Findia%2Finfographic%2Fdussehra.webp&tbnid=gvmFnnIH-
aaNxM&vet=12ahUKEwipx_H21tOAAxU_X2wGHV2aC00QMygAegUIARDyAQ..i&imgrefurl=https%3A%2F
%2Fwww.bankbazaar.com%2Findian-holiday%2Fdussehra-
holiday.html&docid=j85MHKIG1DS04M&w=747&h=641&q=dusshera
%20images&client=ubuntu&ved=2ahUKEwipx_H21tOAAxU_X2wGHV2aC00QMygAegUIARDyAQ">
<p>Click here for link </p> </a>
<p>Information why it is celebrated:</p>
<text>The festival is celebrated as the victory of Lord Rama over Ravana. It also
celebrates the triumph of Goddess Durga over the demon Mahishasura. In many places,
the effigies of Ravana are burned on this day to signify the destruction of evil,
along with fireworks.</text>
<p>When it is celebrated:</p>
<text>Dussehra is celebrated on the 10th day of the month of Ashvina (September–
October) </text>
<p>What you do on this day:</p>
<li>
Doing Saraswati Pujan
</li>
<li>
Making an Effigy of Ravana and Shooting It.</li>
<li> Exchanging Apta (Bauhinia) Leaves with Friends and Family Members.</li>
<li> Story Telling. </li>
<li> Making Rangoli. </li>
<li>Giving Gifts to Loved Ones. </li
<li> Making Sweets. </li>
<li> Visiting Fair.
</li>
<text>
</body>
</html>

OR
Q2. Write a JavaScript code to greet the user according to the current timing. [20
Marks]

<html>
<head>
<title>Greetings of the day</title>
</head>
<body>
<script>
document.write("<center><fontsize=+3style=''color:green;'>");
var day=new Date();
var hr=day.getHours();
if(hr>=0 || hr<12)
{
document.write("Good Morning!");
}else if(h==12){
document.write("Good Noon!");
}else if(hr>=12 || hr<17){
document.write("Good Afternoon!");
}else{
document.write("Good Evening!");
}
document.write("</font></center>");
</script>
</body>
</html>

SLIP 10

Q1. Create HTML page with following specifications:


a) Title should be about MYCOLLEGE.
b) Put the windows logo image in the background.
c) Place your college name at the top of the page in large text followed by address
in
smaller size.
d) Add scrolling text with message of your choice.
ans-
<html>
<head>
<title> COLLEGE</title>
</head>
<body>
<center>
<h1>MIT ACSC ALANDI </h1>
<img src="/home/mitacsc/Pictures/c.jpg" width="400" height="400"></img></center>
<p>About:</p>
<text>Established in 2007, MIT Arts, Commerce and Science College (MITACSC) is
located in Pune, Maharashtra. It comes under the aegis of Maharashtra Academy of
Engineering and Educational Research (MAEER) Pune, which is affiliated with
Savitribai Phule Pune University and recognised by the Government of Maharashtra.
Under the field of Arts, Commerce and Science, the college offers undergraduate and
postgraduate programmes such as BA, BCom, BSc and MSc.

MITACSC was ranked at 72nd position for BBA and 90th position for Science by India
Today in 2019. The college has received various prestigious awards, prizes and
honours for its magnificent contribution to imparting knowledge, inculcating life
skills, developing research skills and providing the best placements to its
students. </text>
<p>Courses:</p>
<li>BCA(SCIENCE)</li>
<li>BCS</li>
<li> BA</li>
<li> BSC </li>
<li> BBA </li>
<li>B.COM </li
<li> MSC(CA) </li>
<li> MCA</li>
<text>
<center>
<iframe src="Ass6c2.html" height=300 width=500>
</iframe>
</center>
</body>
</html>
Q2. Write HTML code to display day wise SYBCA time table in tabular format.
ans-
<html>
<head>
<title>SYBCA TIMETABLE</title>
<h1><b><big><center>SYBCA(Science) TIMETABLE</h1></b></big>
<body>
<center>
<table border="5" | align="center">
<tr>
<td>TIME</td>
<td>8.00-11.00</td>
<td>11.00-11.45</td>
<td>11.45-12.30</td>
<td>12.30-12.55</td>
<td>12.55-1.40</td>
<td>1.40-2.25</td>
<tr>
<td>MONDAY</td>
<td> </td>
<td>DS</td>
<td>CN</td>
<td>L</td>
<td>DBMS</td>
<td>EVS</td>
</tr>
<tr>
<td>TUESDAY</td>
<td>DS</td>
<td>DBMS</td>
<td>CN</td>
<td>U</td>
<td>DS</td>
<td>CN</td>
</tr>
<tr>
<td>WEDNESDAY</td>
<td>DBMS</td>
<td>EVS</td>
<td>CN</td>
<td>N</td>
<td>DBMS</td>
</tr>
<tr>
<td>THURSDAY</td>
<td> </td>
<td>LC</td>
<td>LC</td>
<td>C</td>
<td>DS</td>
<td>CN</td>
</tr>
<tr>
<td>FRIDAY</td>
<td>CN</td>
<td>DBMS</td>
<td>CN</td>
<td>H</td>
<td>DS</td>
<td>WT</td>
</tr>
<tr>
<td>SATURDAY</td>
<td> </td>
<td>DBMS</td>
<td>CN</td>
<td>BREAK</td>
<td> </td>
<td> </td>
</tr>
</tr>
</body>
</html>
OR
Q2. Write a JavaScript program to read employee details using HTML tags. Calculate
and
display net salary of an employee.

<html>
<body>
<h1>payslip</h1>
<form name="payslip">
name of the employee:<input type="text" name="user_name"></input><br>
department:<input type="text" name="department"></input><br>
designation:<input type="text" name="designaion"></input><br>
bacis:<input type="number" name="basic_salary"></input><br>
hra:<input type="number" name="hra"></input><br>
da:<input type="number" name="da"></input><br>
<button type="button" onclick="calculate();"></button>
</form>
<script>
function calculate(){
var bs=parseInt(document.payslip.basic_salary.value);
var hra=parseInt(document.payslip.hra.value);
var da=parseInt(document.payslip.da.value);
var netsal=parseInt(bs+hra+da);
document.writeln("salary="+netsal);
}
</script>
</body>
</html>
SLIP 11
Q1. Execute the following commands. Also write its use.
a) Ping
b) Who
c) hostname
d) Traceroute
e) Netstat
[
Q2 Write HTML code to generate the following output. Add two more colors in
following
table.
[20 Marks]
HTML Colors
Color
Name
hexadecimal
RGB value
Salmon FA8072 250-128-114
Gold FFD700 250-215-0
OR
Q2. Write a menu driven program using JavaScript to find square root, power and
absolute
value of a given number and validate them.

<html>
<head>
<title>Math functions</title>
<head>
<body>
<script>
var num=prompt('Enter a number: ');
var sqrroot=Math.sqrt(num);
alert('Square root '+sqrroot);
var p=prompt('Enter the power: ' );
var power=Math.pow(num,p);
alert(power);
var av=Math.abs(num);
alert(av);
</script>
</body>
</html>

SLIP 12
Q.1 Execute the following commands. Also write its use.
a) Netstat
b) nmap
c) nslookup
d) Ping
e) Who
Q2. Write HTML code to generate the following output:
Company wise Profit
Company Name
Infosys
Wipro
Cognizant
Year
2018
2019
2020
2018
2019
2020
2018
2019
2020
Profit (In Crore)
6520
7250
7962
1803
1953
2529
5420
5863
6293
ANS-<html>
<body>
<center><table border=1 width=40% cellpadding=1 cellspacing=1 >
<tr>
<th>Company Name </th>
<th> Year</th>
<th> Profit(In Crore)</th>
</tr>
<tr align="center"><center>
<td rowspan=3 > Infosys</td>
<td >2018</td>
<td>6520</td>
</center>
</tr>
<tr><center>
<td align="center" > 2019</td>
<td align="center" >7250</td>
</center>
</tr>
<tr><center>
<td align="center" >2020</td>
<td align="center">7962 </td>
</center>
</tr>
<tr align="center"><center>
<td rowspan=3 > Wipro</td>
<td >2018</td>
<td>1803</td>
</center>
</tr>
<tr><center>
<td align="center" > 2019</td>
<td align="center" >1953</td>
</center>
</tr>
<tr><center>
<td align="center" >2020</td>
<td align="center">2529</td>
</center>
</tr>
<tr align="center"><center>
<td rowspan=3 > Cognizant</td>
<td >2018</td>
<td>1803</td>
</center>
</tr>
<tr><center>
<td align="center" > 2019</td>
<td align="center" >1953</td>
</center>
</tr>
<tr><center>
<td align="center" >2020</td>
<td align="center">2529</td>
</center>
</center>
</body>
</html>

OR
Q2. Write a JavaScript Program to read a number from user, store its factors into
the array
and display that array.
[20 Marks]

<html>
<head>
<title>Math functions</title>
<head>
<body>
<script>
var num=prompt('Enter a number: ');
var sqrroot=Math.sqrt(num);
alert('Square root '+sqrroot);
var p=prompt('Enter the power: ' );
var power=Math.pow(num,p);
alert(power);
var av=Math.abs(num);
alert(av);
</script>
</body>
</html>
Q3. Viva
Q4. Internal Assessment

SLIP 13
Q1. Write HTML code to display names of html text formatting tags and output in
tabular format.
Tag name Output
b Bold
I Italic
U Underline
ANS-<html>
<body>
<center><table border=1 width=40% cellpadding=1 cellspacing=1 >
<tr>
<th>Tag name </th>
<th> Output</th>
</tr>
<tr><center>
<td align="center" > b</td>
<td align="center" ><b>bold</b></td>
</center>
</tr>
<tr><center>
<td align="center" > I</td>
<td align="center" ><i>Italic</i></td>
</center>
</tr>
<tr><center>
<td align="center" > U</td>
<td align="center" ><u>Underline</u></td>
</center>
</tr>
</center>
</body>
</html>

Q2. Write HTML code to generate the following output and display each element of
list in different size, color & font. Use external CSS to format the list.

OR
Q2. Write a JavaScript function to validate email-id using regular expression. [20
Marks]

<html>
<head>
<title>name & mobile number validation</title>
<script>
function Vemail(mail)
{
var mailformat=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
if(uemail.value.match(mailformat))
{
return true;
}
else
{
alert("You have entered an invalid email address!");
uemail.focus();
return false;
}
}
Vemail(uemail);
</script>
</head>
<body onload="document.form1.uname.focus();">
<form name="form1" onSubmit="return Vemail(uemail);">
Email: <input type="text" id="uemail" /><br>
<input type="submit" name="submit" value="submit"/>
</body>
</html>

SLIP 14
Q1. Create HTML page with all the different text styles (bold, italic and
underlined) and
its combinations onseparate lines. State style of each line in its text.

Q2. Write HTML code to display Product and its subtypes in tabular format. Add more
products ofyour choice in following table.
Sr. No
Product Name
1 Pulses
2 Everest Masala
Product subtypes
• Toor daal
• Moong daal
• Udad daal
• Sambhar masala
• Pavbhaji masala
• Kichen king masala
Ans-<html>
<head>
<title>HTML </title>
<body>
<center>
<table border=1 width=30% cellpadding=3 cellspacing=3>
<tr>
<th>Sr.No</th>
<th>Product Name</th>
<th>Product subtypes</th>
</tr>
<tr>
<td align=center>1 </td>
<td align=center> Pulses</td>
<td >
<li>Toor daal</li>
<li>Moong daal</li>
<li>udad daal</li></td>
</tr>
<tr>
<td align=center>2 </td>
<td align=center> Everest Masala</td>
<td rowspan=3>
<li>Sambhar Masala</li>
<li>Pavbhaji Masala</li>
<li>Kitchen King Masala</li></td>
</tr>
</center>
</table>
</body>
</head>
</html>

OR

Q2. Write a JavaScript program for accepting name and mobile number from user and
perform following validation:
[20 Marks]
a) Check all fields should not contain a null value
b) Check name field contains only alphabets
c) Mobile No. field should be of 10 digits long.

<html>
<head>
<title>name & mobile number validation</title>
<script>
function formvalidation()
{
var uname=document.form1.uname;
var num=document.form1.unum;
if(username(uname))
{
if(mobileNo(num))
{

}
}
}

function mobileNo(unum)
{
var numbers=/^[0-9]+$/;
if(unum.value.match(numbers))
{
return true;
}
else
{
alert('Mobile number should be numerisc');
unum.focus();
return false;
}
}

function username(uname)
{
var letters=/^[A-Za-z]+$/;
if(uname.value.match(letters))
{
return true;
}
else
{
alert('Username must hae alpabet charecters only');
uname.focus();
return false;
}
}

</script>
</head>
<body onload="document.form1.uname.focus();">
<form name="form1" onSubmit="return formvalidation();">
Name: <input type="text" id="uname" /><br>
Mobile: <input type="number" id="unum"/><br>

<input type="submit" name="submit" value="submit"/>


</body>
</html>

SLIP 15

Q.1. Create HTML page with following specifications


[10 Marks]
a) Title should be about myCity
b) Place your City name at the top of the page in large text and in blue color
c) Add names of landmarks in your city each in a different color, style and
typefaced.
d) One of the landmark, your college name should be blinking.
e) Add scrolling text with a message of your choice.

Q2. Write HTML code to generate the following output:

OR

Q2. Write a JavaScript program to print the reverse of a number. [20 Marks]

<html>
<head>
<title>Reverse of number</title>
</head>
<body>
<script>

let num=prompt("Enter the number");


let rev=0,rem=0;
while(num>0){
rem=num%10;
rev=rev*10+rem;
num=parseInt(num/10);

}
alert(rev);

</script>
</body>
</html>

SLIP 16
Q1. Write HTML code to display the rainbow color names using Ordered List. Modify
the
code to display each color name with the same color of rainbow using font tag.
Apply
page background color as black.

Q2. Write HTML code to generate the following output:

OR
Q2. Write a JavaScript program to accept a number from user and display that number
in
words (e.g. 226 Two Two Six)

<html>
<head>
<title>Number in words</title>
</head>
<body>
<script>
var number=parseInt(prompt('Enter the number:'));

let rev=0,rem=0;
while(number>0){
rem=number%10;
rev=rev*10+rem;
number=parseInt(number/10);
}

while(rev>0){
let rem=rev%10;
switch(rem)
{
case 1:document.write("One ");
console.log('One');
break;
case 2: document.write("Two ");
break;
case 3: document.write("Three ");
break;
case 4: document.write("Four ");
break;
case 5: document.write("Five ");
break;
case 6: document.write("Six ");
break;
case 7: document.write("Seven ");
break;
case 8: document.write("Eight ");
break;
case 9: document.write("Nine ");
break;
}
rev=parseInt(rev/10);
}
</script>
</body>
</html>

SLIP 17
Q1. Write HTML script with internal CSS to display following screen:

<html>
<head>
<title>Link Tag</title>
</head>
<body>
<center>
To illustrate link Tags
</center>
Text as a link/hyperlink to another page:<a
href="file:///home/mitacsc/SU27/3A3.html">Click here!!!</a><hr>
Image as a link/hyperlink:<a href="https://thumbs.dreamstime.com/b/environment-
earth-day-hands-trees-growing-seedlings-bokeh-green-background-female-hand-holding-
tree-nature-field-gra-130247647.jpg"><img
src="https://thumbs.dreamstime.com/b/environment-earth-day-hands-trees-growing-
seedlings-bokeh-green-background-female-hand-holding-tree-nature-field-gra-
130247647.jpg" width=50 height=30></img></a><br>
<a href="https://www.google.com/url?
sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwjr5eDHyrCAAxXoS2wGHes
YCEAQFnoECBIQAQ&url=https%3A%2F%2Fbyjus.com%2Fncert-solutions-class-10-maths
%2Fchapter-8-introduction-to-trigonometry
%2F&usg=AOvVaw38Ri5ABQBRDn1xmxoShauX&opi=89978449">See also Chapter(link within a
page)</a><br>
<h2>Chapter 1</h2><br>
<h5>This chapter explains Pointers</h5><br>
<h2>Chapter 2</h2><br>
<h5>This chapter explains variables</h5><br>
<h2>Chapter 3</h2><br>
<h5>This chapter explains operator</h5><br>
<h2>Chapter 4</h2><br>
<h5>This chapter explains structure</h5><br>
</body>
</html>

Q2. Write HTML code to divide the frame into different sections as shown below and
add
appropriate html files to each frame.
[20 Marks]
OR
Q2. Write a JavaScript Program to read a number from user, store its factors into
the array
and display that array.

<html>
<head>
<title>Factors in array</title>
<head>
<body>
<script>

var num=parseInt(prompt('Enter the number:'));


var arr=new Array();
var i;
for(i=1;i<num;i++)
{
if(num%i==0)
{
arr[i-1]=parseInt(i);
}
}
for(i=0;i<arr.length;i++)
{
console.log(arr[i])
}

</script>
</body>
</html>

SLIP 18
Q1. Write HTML code to generate the following output:
SYBCA (Science) Subjects
IV. Data Structures
o
o
Algorithms and analysis of algorithms
Static and dynamic data structures
V. Database Management Systems II
• Advanced SQL features and procedural SQL
• Concurrency control and crash recovery
VI. Computer Networks
▪ Protocols at various layers in the protocolstacks
▪ Techniques for framing, error control, flow control and routing
ans-<html>
<head>
<title>SYBCA</title>
</head>
<h1><b><big><center>SYBCA(Science) Course Objectives </h1></b></big>
<body>
<ol>
<li>Data Structurs</li>
<ul type="circle">
<li>To understand algorithms and analysis of algorithms</li>
<li>To learn static and dynamic data structures</li>
</ul>

<li>Database Management System2</li>


<ul type="disc">
<li>To understand advanced SQL features and procedural SQL</li>
<li>To study concurrency control and crash recovery techniques</li>
</ul>
</ol>
</body>
</html>

Q2. Create HTML page giving information about celebrating Dussehra in your country.
Use various tags in HTML to give it a pleasant look. It should be having following
links. Create separate HTML page for each link and display the respective
information.
a) Information why it is celebrated
b) When it is celebrated
[20 Marks]
c) What you do on this day
OR
Q2. Write a menu driven program using JavaScript to find square root, power and
absolute
value of a given number and validate them.

<html>
<head>
<title>Math functions</title>
<head>
<body>
<script>
var num=prompt('Enter a number: ');
var sqrroot=Math.sqrt(num);
alert('Square root '+sqrroot);
var p=prompt('Enter the power: ' );
var power=Math.pow(num,p);
alert(power);
var av=Math.abs(num);
alert(av);
</script>
</body>
</html>

SLIP 19
Q1. Write HTML code for the following:
a) Display following polynomial expression:
15X 4 + 9X 3 + 4X 2 + 2X + 4 = 0
Display coefficient in Bold.

b) Display the text message as “S.Y.B.C.A. (Science)” at center with different


heading
styles in different colors.

Q2. Write HTML code to generate the following output:


[20 Marks]
OR
Q2. Write a JavaScript program to print factorial of a given number. [20 Marks]

<html>
<head>
<title>factorial of a number</title>
</head>
<body>
<script>
var num=prompt("Enter a number");
var fact=1;
if(num==0||num==1)
{
alert(fact);
}
else if(num>1){
for(var i=1;i<=num;i++){
fact*=i;
}
alert(fact);
}
</script>
</body>
</html>

SLIP 20
Q1. Create HTML page with following specifications:
[10 Marks]
a) Title should be about MYCOLLEGE.
b) Put the windows logo image in the background.
c) Place your college name at the top of the page in large text followed by address
in
smaller size.
d) Add scrolling text with message of your choice.
Q2. Write HTML code to generate the following output:

Company wise Profit


Company Name
Infosys
Wipro
Cognizant
Year
2018
2019
2020
2018
2019
2020
2018
2019
2020
Profit (In Crore)
6520
7250
7962
1803
1953
2529
5420
5863
6293
OR
Q2. Write a JavaScript code to greet the user according to the current timing.

<html>
<head>
<title>Greetings of the day</title>
</head>
<body>
<script>
document.write("<center><fontsize=+3style=''color:green;'>");
var day=new Date();
var hr=day.getHours();
if(hr>=0 || hr<12)
{
document.write("Good Morning!");
}else if(h==12){
document.write("Good Noon!");
}else if(hr>=12 || hr<17){
document.write("Good Afternoon!");
}else{
document.write("Good Evening!");
}
document.write("</font></center>");

</script>
</body>
</html>

You might also like