Anirudh WT Assignment

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 14

VISVESVARAYA TECHNOLOGICAL

UNIVERSITY
Jnana Sangama,Belgavi-590018

A WT LABORATORY REPORT

of

BACHELOR OF ENGINEERING

In

COMPUTER SCIENCE & ENGINEERING

Submitted By

ANIRUDH LP(1TJ18CS007)

UNDER THE GUIDANCE OF


MS. PRIYANKA
ASST.PROFESSOR
Department of Computer Science and Engineering

(Affiliated to Visvesvaraya Technological University)


Approved by AICTE, Govt. of India, New Delhi.
#88/1, Gottigere, Bannerghatta Road, Bengaluru-560083
2021-2022

1
(Affiliated to Visvesvaraya Technological University)
Approved by AICTE, Govt. of India, New Delhi.
#88/1, Gottigere, Bannerghatta Road, Bengaluru-560083
2021-2022
CERTIFICATE

Certified that the mini project work entitled "WT LABORATORY REPORT” carried out by “ANIRUDH LP
(USN:1TJ18CS007)”, bona fide student of T. John Institute of Technology in partial fulfillment for fifth
semester of Bachelor of Engineering in Computer Science and Engineering of Visvesvaraya Technological
University, Belagavi, during the year 2020-21. It is certified that all corrections/suggestions indicated for
Internal Assessment have been incorporated in the report deposited in the departmental library. The mini
project report has been approved as it satisfies the academic requirements in respect of mini project work
prescribed for the said degree.

GUIDE HOD
Prof. PRIYANKA Prof. Suma R
Assistant Professor Assoc. Professor & Head

2
DECLARATION

“ANIRUDH (USN:1TJ18CS007) Sixth semester student declare that the mini project entitled “WT
LABORATORY REPORT” has been carried out and submitted by me in partial fulfillment of fifth
semester of Bachelor of Engineering in Computer Science and Engineering, Visvesvaraya
Technological University, Belagavi during the academic year 2020-21. I also declare that, to the best of
my knowledge and belief, the work reported here is accepted and satisfied.

ANIRUDH(USN:1TJ18CS0
07)
ACKNOWLEDGEMENT

The project report on “WT LABORATORY REPORT” is the outcome of guidance, moral support and
knowledge imparted on me, throughout my work. For this I acknowledge and express immense
gratitude to all those who have guided and supported me during the preparation of this mini project.

I take this opportunity to express my gratefulness to everyone who has extended their support for
helping me in the mini project completion.

First and foremost, I thank Dr. Thomas P. John, Chairman of T. John Group of Institutions and Dr. P
.Suresh Venugopal, Principal, T. John Institute of Technology for giving me this opportunity to study in
this prestigious institute and also providing me with best of facilities.

I would like to show my greatest appreciation to Prof. Suma R, HOD, Dept of CSE and Prof. Priyanka,
Mini Project Guide, Dept. of CSE and Guide for constantly guiding me throughout the project.

I would also like to thank to all teaching and non-teaching staff of Computer Science and Engineering
Department for directly or indirectly helping me in completion of Mini Project.

Lastly and most importantly I convey my gratitude to my parents who have been the source of
inspiration and also for instrumental help in successful completion of project.

ANIRUDH LP (USN:1TJ18CS007)
ABSTRACT

In this report we have solved some programs related to JS programs,HTML


programs,and PHP program.
SL NO. TITLE PAGE NO

1. Simple Calculator 7

2. Text Growing and Shrinking 9

3. String 11

4. Cube 12

5. Student Database 13
1.Write a JavaScript to design a simple calculator to perform the following
operations: sum, product, difference and quotient.

<html>
<head>
<title>My calculator</title>
<script type="text/javascript">
function call(click_id)
{
var v1=parseFloat(document.getElementById("ip1").value);
var v2=parseFloat(document.getElementById("ip2").value);
if(isNaN(v1) || isNaN(v2))
alert("enter a valid number");
else if(click_id=="add")
document.getElementById("output").value=v1+v2;
else if(click_id=="sub")
document.getElementById("output").value=v1-v2;
else if(click_id=="mul")
document.getElementById("output").value=v1*v2;
else if(click_id=="div")
document.getElementById("output").value=v1/v2;
}
</script>
</head>
<body>
<center>
<h1> A SIMPLE CALCULATOR PROGRAM</h1>
<table style="background-color:yellow" align=="center">
<tr>
<td>
<form method="get" action="">
<div width=50% align="center">
<label>OP1<input type="text" id="ip1"/></label>
<label>op2<input type="text" id="ip2"/></label>
<lablel>total<input type="text" id="output"/></label>
</div>
<br>
<div width=50% align="center">
<input type="button" value="+" id="add" onclick="call(this.id)"/>
<input type="button" value="-" id="sub" onclick="call(this.id)"/>
<input type="button" value="*" id="mul" onclick="call(this.id)"/>
<input type="button" value="/" id="div" onclick="call(this.id)"/>
<input type="reset" value="clear"/>
</div>
</form>
</td>
</tr>
</table>
</center>
</body>
</html>
2.Write a JavaScript code that displays text “TEXT-GROWING” with increasing font
size in the interval of 100ms in RED COLOR, when the font size reaches 50pt it displays
“TEXT-SHRINKING” in BLUE color. Then the font size decreases to 5pt.

<html>
<body>
<p id="demo"></p>
<script>
var var1 = setInterval(inTimer, 1000);
var size = 5;
var ids = document.getElementById("demo");
function inTimer() {
ids.innerHTML = 'TEXT GROWING';
ids.setAttribute('style', "font-size: " + size + "px; color: red");
size += 5;
if(size >= 50 ){
clearInterval(var1);
var2 = setInterval(deTimer, 1000);
}
}
function deTimer() {
size -= 5;
ids.innerHTML = 'TEXT SHRINKING';
ids.setAttribute('style', "font-size: " + size + "px; color: blue");
if(size == 5 ){
clearInterval(var2);
}
}
</script>
</body>
</html>

Output:-
3.Develop and demonstrate a HTML5 file that includes JavaScript script that uses
functions for the following problems:
a. Parameter: A string
b. Output: The position in the string of the left-most vowel
c. Parameter: A number
d. Output: The number with its digits in the reverse order
<html>
<body>
<script type="text/javascript">
var str = prompt("Enter the Input","");
if(isNaN(str))
{
str = str.toUpperCase();
for(var i = 0; i < str.length; i++) {
var chr = str.charAt(i);
if(chr == 'A' || chr == 'E' || chr == 'I' || chr == 'O' || chr == 'U')break;
}
if( i < str.length )
alert("The position of the left most vowel is "+(i+1));
else
alert("No vowel found in the entered string");
}
else
{
var num,rev=0,remainder;
num = parseInt(str);
while(num!=0) {
remainder = num%10;
num = parseInt(num/10);
rev = rev * 10 + remainder;
}
alert("Reverse of "+str+" is "+rev);
}
</script>
</body>
</html>
4.Write a JavaScript that calculates the squares and cubes of the numbers from 0 to 10
and outputs HTML text that displays the resulting values in an HTML table format.

<html>
<head>
</head>
<body>
<table align="center" border=1>
<tr><td>number</td><td>square</td><td>cube</td></tr>
<script type="text/javascript">
for(var n=0; n<=10; n++)
{
document.write( "<tr><td>" + n + "</td><td>" + n*n + "</td><td>" + n*n*n
+ "</td></tr>" ) ;
}
</script>
</table>
</body>
</html>
5.Design an XML document to store information about a student in an engineering
college affiliated to VTU. The information must include USN, Name, and Name ofthe
College, Branch, Year of Joining, and email id. Make up sample data for 3students.
Create a CSS style sheet and use it to display the document.
<?xml-stylesheet type="text/css" href="6.css" ?>
<!DOCTYPE HTML>
<html>
<head>
<h1> STUDENTS DESCRIPTION </h1>
</head>
<students>
<student>
<USN>USN : 1CG15CS001</USN>
<name>NAME : SANTHOS</name>
<college>COLLEGE : CIT</college>
<branch>BRANCH : Computer Science and Engineering</branch>
<year>YEAR : 2015</year>
<e-mail>E-Mail : santosh@gmail.com</e-mail>
</student>
<student>
<USN>USN : 1CG15IS002</USN>
<name>NAME : MANORANJAN</name>
<college>COLLEGE : CITIT</college>
<branch>BRANCH : Information Science and Engineering</branch>
<year>YEAR : 2015</year>
<e-mail>E-Mail : manoranjan@gmail.com</e-mail>
</student>
<student>
<USN>USN : 1CG15EC101</USN>
<name>NAME : CHETHAN</name>
<college>COLLEGE : CITIT</college>
<branch>BRANCH : Electronics and Communication Engineering
</branch>
<year>YEAR : 2015</year>
<e-mail>E-Mail : chethan@gmail.com</e-mail>
</student>
</students>
</html>
6.css
student{
display:block; margin-top:10px; color:Navy;
}
USN{
display:block; margin-left:10px;font-size:14pt; color:Red;
}
name{
display:block; margin-left:20px;font-size:14pt; color:Blue;
}
college{
display:block; margin-left:20px;font-size:12pt; color:Maroon;
}
branch{
display:block; margin-left:20px;font-size:12pt; color:Purple;
}
year{
display:block; margin-left:20px;font-size:14pt; color:Green;
}
e-mail{
display:block; margin-left:20px;font-size:12pt; color:Blue;
}

You might also like