Ammu Web
Ammu Web
Ammu Web
PROGRAM:
<html>
<title>CALCULATOR</title>
</style>
<body>
<div align="center">
<h2>SIMPLE CALCULATOR</h2>
<h5>1JB21CS408</h5>
<script type="text/javascript">
a = ['1','2','3','+','4','5','6','-','7','8','9','*','C','0','=','/']
></td>'); continue ;
onclick="cal.get.value
{ document.write(z+a[i]+'" onclick="cal.get.value
+=\''+a[i]+'\'"></td></tr><tr rowspan="2">');
onclick="cal.get.value +=\''+a[i]+'\'"></td>'); }
doument.write('</table></form></div>');
</script> </body>
</html>
OUTPUT:
2: 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.
PROGRAM:
<!DOCTYPE HTML>
<html>
<head><h4 align="center";>1JB21CS408</h4><style>
bordercollapse: collapse;
backgroundcolor:lightblue;
} table { margin:auto;}
</style>
document.write("<tr><td>Number</td><td>Square</td><td>Cube</td></tr>"); for(var
n=0;n<=10;n++)
"</td></tr>");
} document.write("</table>");
</script>
</head>
</html>
OUTPUT :
3: Develop and demonstrate a HTML5 file that includes JavaScript script that
uses functions for the following problems:
a. Parameter: A string
c. Parameter: A number
PROGRAM :
<!DOCTYPE HTML>
<html>
<body>
if(!(isNaN(str)))
{ var num,rev=0,remainder;
num
= parseInt(str);
while(num!=0) {
parseInt(num/10); rev =
rev * 10 + remainder; }
alert("Reverse of "+str+" is
"+rev);
</script>
</body>
</html>
OUTPUT :
PROGRAM :
<!DOCTYPE HTML>
<html>
-50%); }
</style>
</head>
<body>
<p id="demo"></p>
ids.innerHTML =
'TEXT SHRINKING';
=== 5 ){ clearInterval(var2); }}
</script>
</body>
</html>
OUTPUT :
PROGRAM :
<!DOCTYPE HTML>
<html>
<head>
</head>
<students>
<student>
<USN>USN : 1JB15CS001</USN>
<name>NAME : SANVI</name>
<college>COLLEGE : SJBIT</college>
<year>YEAR : 2015</year>
<e-mail>E-Mail : sanvi@gmail.com</e-mail>
</student>
<student>
<USN>USN : 1JB15IS002</USN>
<name>NAME : MANORANJAN</name>
<college>COLLEGE : SJBIT</college>
<year>YEAR : 2015</year>
<e-mail>E-Mail : manoranjan@gmail.com</e-mail>
</student>
<student>
<USN>USN : 1JB13EC003</USN>
<name>NAME : CHANDANA</name>
<college>COLLEGE : SJBIT</college>
</branch>
<year>YEAR : 2013</year>
<e-mail>E-Mail : chandana@gmail.com</e-mail>
</student>
</students>
left:20px;fontsize:12pt; color:Purple;
OUTPUT :
6: Write a PHP program to keep track of the number of visitors visiting the web
page and to display this count of visitors, with proper headings.
PROGRAM :
</h3>";
$name="counter.txt"; $file =
fopen($name,"r"); $hits=
fscanf($file,"%d"); fclose($file);
$hits[0]++;
$file = fopen($name,"w");
fprintf($file,"%d",$hits[0]); fclose($file);
?>
OUTPUT :
7. Write a PHP program to display a digital clock which displays the current time
of the server.
PROGRAM :
<html>
<head>
h1{text-align= center;}
</style>
echo"<hr>"; ?>
</body>
</html>
OUTPUT :
PROGRAM :
<html>
<head>
<style> table, td,
th {
{ text-align:right; }
</style>
</head> body>
<form method="post">
<table>
<tr><td>First Number:</td>
NUMBER');</script>";
}}
?>
</body>
</html>
OUTPUT :
Program8b.php
$a = array(array(1,2,3),array(4,5,6),array(7,8,9));
$b = array(array(7,8,9),array(4,5,6),array(1,2,3));
$m=count($a);
$n=count($a[2]);
$p=count($b);
$col++)
<br/>";
$result[$i][$j] = 0; for($k=0;
$result[$i][$j] +=
$a[$i][$k] * $b[$k][$j];
"<br/>";
}}
?>
OUTPUT :
9. Write a PHP program named states .py that declares a variable states with
value "Mississippi Alabama Texas Massachusetts Kansas". write a PHP program
that does the following:
a) Search for a word in variable states that ends in xas. Store this word in
element 0 of a list named statesList.
b) Search for a word in states that begins with k and ends in s. Perform a
caseinsensitive comparison. [Note: Passing re.Ias a second parameter to
method compile performs a case-insensitive comparison.] Store this word
in element1 of
statesList.
c) Search for a word in states that begins with M and ends in s. Store this
word in element 2 of the list.
d) Search for a word in states that ends in a. Store this word in element 3 of
the list.
PROGRAM :
<?php
$statesArray = [];
if(preg_match('/^k.*s$/i', ($state)))
$statesArray[1] = ($state); }
foreach($states1 as $state) {
if(preg_match('/^M.*s$/', ($state)))
print("STATES[$array]=$value<br>");
?>
OUTPUT :
10. PHP:program to sort the student records using selection sort 22-23
INTRODUCTION:
In this project, you will be implemeting a rock-paper-scissors game! Rock-paper-scissors is a
hand game played between two people, in which each player simultaneously forms one of three
shapes with an outstretched hand. These shapes are "rock" (a simple fist), "paper" (a flat hand),
and "scissors" (a fist with the index and middle fingers extended, forming a V).
A player who plays rock will beat another player who has chosen scissors, but will lose to one
who has played paper; a play of paper will lose to a play of scissors. If both players choose
the same shape, the game is tied. See the image below for a visual representation of the rules
of rock-paper-scissors:
DESIGN
• In many games, it is common for a group of possible choices to interact in a rock paper
scissors style, where each selection is strong against a particular choice, but weak
against another. Such mechanics can make a game somewhat self-balancing, prevent
gameplay from being overwhelmed by a single and single dominant type of unit.
• Many card-based video games in Japan use the rock paper scissors system as their core
fighting system, with the winner of each round being able to carry out their designated
attack. In the player has to win games of rock paper scissors against each boss to
proceed. Others use simple variants of rock paper scissors as subgames.
• Many role-playing games prominently feature a rock paper scissors gameplay element.
In there is a rock paper scissors element in the type effectiveness system. For example,
a Grass-typed Pokémon is weak to Fire, Fire is weak to Water, and Water is weak to
• system based on the game's three attack types: Melee, Ranged, and Flying. In the series
of strategy role-playing games, the Weapon Triangle and Trinity of Magic influence the
hit and damage rates of weapon types based on whether they are at an advantage or a
disadvantage in their respective rock paper scissors system. In the series, the three basic
actions used during battles are described in their respective rock paper scissors system:
attack, defense, and grab.
IMPLIMENTATION
HARDWARE REQUIREMENTS
• Ram 8GB is used as it will provide fast reading and writing capabilities
and will in turn support in processing.
SOFTWARE REQUIREMENTS
• Operating system- Windows 11 is used as the operating system as it is stable
and supports more features and is more user friendly.
CODE
html {
box-sizing: border-box;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
*{
margin: 0;
padding: 0;
}
body {
background: #122a33;
color: #fff;
font-family: "Roboto", sans-serif;
}
code {
font-family: 'Source Code Pro', monospace;
font-size: 12px;
}
a{
font-family: 'Source Code Pro', monospace;
color: #ffcc99;
}
a:hover {
color: #ffba76;
}
header {
background: #ffac16;
padding: 20px;
}
header h1 {
color: #444; text-
align: center;
font-weight: 100;
}
.score-board { border:
3px solid #fff; width:
300px; margin: 40px
auto; font-size: 40px;
border-radius: 4px;
text-align: center;
padding: 15px 20px;
position: relative;
.badge {
background: #e2584d; text-
transform: uppercase; font-size:
14px;
padding: 10px 6px;
}
#user-label {
position: absolute;
top: 50%;
left: -5%;
transform: translate(-10%, -50%);
}
#computer-label {
position: absolute;
top: 50%;
right: -5%;
transform: translate(10%, -50%);
}
.result {
font-weight: 300;
text-align: center;
font-size: 32px;
line-height: 40px;
}
.result {
line-height: 50px;
}
.choices {
margin: 0 auto;
text-align: center;
padding: 40px 0;
}
.choice {
display: inline-block;
border: 3px solid #fff;
border-radius: 50%;
padding: 10px;
margin: auto 10px;
transition: all 0.3s ease;
}
#action-message { text-align:
center; font-weight: 500;
text-transform: uppercase;
letter-spacing: 2px;
margin: 40px 0;
}
.losingStyles {
border: 3px solid #c52e2e; background-
color: #2e0303;
box-shadow: 0 0 20px #2e0303;
}
sup {
margin: 0;
padding: 0;
}
RESULTS/SNAPSHOTS:
Fig 1.1 The sensor glove was designed to be worn on the right hand of a player and track the
acceleration of the hand as well as the movement of the index and ring fingers.
Fig 1.2 The sensor glove was designed to be worn on the right hand of a player and track
the acceleration of the hand as well as the movement of the index and ring fingers.
Fig 1.3 a certain type of mapping between the possible moves and numbers, in
order to determine the winner and the loser.
Fig 1.4 Rock,Paper and scissors is a game played by using hands which can also be
used as a toss when a decision on somethimg between two people
REFERENCES
1. "Game Basics". Archived from the original on 2019-03-22. Retrieved 200912-
05.
2. St. John, Kelly (2003-03-19). "Ready, set ... Roshambo! Contestants vie for
$1,000 purse in Rock, Scissors, Paper contest". San Francisco Chronicle.
Retrieved 2007-11-20.
3. Wells, Steven (2006-11-24). "It's not your dad's ick-ack-ock". The Guardian.
Retrieved 2013-08-13.
4. Fisher, Len (2008). Rock, Paper, Scissors: Game Theory in Everyday Life.
Basic Books. p.
5. Fisher, Len (2008). Rock, paper, scissors: game theory in everyday life. Basic
Books. p.