Professional Documents
Culture Documents
<html>
<head>
<title>calculator</title>
<style>
Body{
padding:100px 500px;
section{
border:10px solid;
padding-bottom:50px;
input[type="button"]
background-color:white;
width:100%
input[type="text"]
background-color:white;
#but1:hover,#but2:hover,#but3:hover,#but4:hover,#but5:hover;
background-color:black;
cursor:pointer;
</style>
</head>
<body>
<center>
<section>
<h1>Simple Calculator</h1>
<table border="1">
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
</table><br>
<button id="but5" onclick="cgpa()"
style=backgroundcolor:grey;>CGPA</button>
</section>
</center>
</body>
</html>
<script>
function view(num)
document.getElementById("result").value+=num
function compute()
let x=document.getElementById("result").value
let y=eval(x)
document.getElementById("result").value=y
function clr()
document.getElementById("result").value=""
}
function remo()
var str=document.getElementById("result").value;
str=str.substring(0,str.length-1);
document.getElementById("result").value=str;
function cgpa()
document.getElementById("result").value=(document.getElementById("result").value)/9.5;
</script>