Kalkulator
Ida Ayu Kade Suryani ACA 111 0101
<html>
<head>
<title align="center">Kalkulator Scientific</title>
<style type="text/css">
<!--
.style2 {
font-size: x-large;
color: #CC0000;
font-style: italic;
font-family: "Times New Roman", Times, serif;
}
body {
background-image: url(1366_768_311008533.jpg);
background-color: #CC0033;
}
.style6 {
color: #CC0000;
font-style: italic;
font-family: "Times New Roman", Times, serif;
}
body,td,th {
color: #000099;
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body align="center">
<div align="center">
<h3 class="style2">Ida Ayu Kade Suryani ACA 111 0101</h3>
<h3 class="style2">Sistem Informasi</h3>
<h3 class="style2">Kalkulator</h3>
</div>
<tr>
<link href="../../../Users/sisii/AppData/Local/Temp/Rar$EX73.368/11650102_Kalkulator Scientific JS/style.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
function addChar(input, character){
if(input.value == null || input.value == "0")
input.value = character
else
input.value += character
}
function cos(form) {
form.display.value = Math.cos((form.display.value)*(Math.PI/180));
}
function acos(form){
form.display.value = Math.acos(form.display.value)/(Math.PI/180);
}
function sin(form) {
form.display.value = Math.sin((form.display.value)*(Math.PI/180));
}
function asin(form){
form.display.value = Math.asin(form.display.value)/(Math.PI/180);
}
function tan(form) {
form.display.value = Math.tan((form.display.value)*(Math.PI/180));
}
function atan(form){
form.display.value = Math.atan(form.display.value)/(Math.PI/180);
}
function sqrt(form) {
form.display.value = Math.sqrt(form.display.value);
}
function ln(form) {
form.display.value = Math.log(form.display.value);
}
function exp(form) {
form.display.value = Math.exp(form.display.value);
}
function PI(form) {
form.display.value = Math.PI(form.display.value);
}
function deleteChar(input) {
input.value = input.value.substring(0, input.value.length - 1)
}
function changeSign(input) {
if(input.value.substring(0, 1) == "-")
input.value = input.value.substring(1, input.value.length)
else
input.value = "-" + input.value
}
function compute(form) {
form.display.value = eval(form.display.value);
}
function square(form) {
form.display.value = eval(form.display.value) * eval(form.display.value)
}
function log(form) {
form.display.value = Math.log10(form.display.value);
}
function checkNum(str) {
for (var i = 0; i < str.length; i++) {
var ch = str.substring(i, i+1)
if (ch < "0" || ch > "9") {
if (ch != "/" && ch != "*" && ch != "+" && ch != "-" && ch != "."
&& ch != "(" && ch!= ")") {
alert("invalid entry!")
return false
}
}
}
return true
}
</script>
<form name="sci-calc">
<table width="640" align="center" cellpadding="2" cellspacing="3" bgcolor="#666666">
<!--DWLayoutTable-->
<tbody>
<tr>
<td height="97" colspan="11" align="center" ><table width="500" height="62" border="2" cellpadding="1" cellspacing="1">
<tr>
<td width="700" height="56"><textarea name="display" cols="100" class="blue">0</textarea></td>
</tr>
</table></td>
</tr>
<tr>
<td width="68" height="40" align="center"><table width="1" border="2" cellspacing="1" cellpadding="1">
<tr>
<td><input name="button23" type="button" onClick="if (checkNum(this.form.display.value)) { exp(this.form) }" value=" EXP "></td>
</tr>
</table></td>
<td width="90" align="center" ><table width="42" border="2" cellspacing="1" cellpadding="1">
<tr>
<td width="32"><input name="button9" type="button" onClick="addChar(this.form.display, '7')" value=" 7 "></td>
</tr>
</table></td>
<td width="67" ><table width="43" border="2" cellspacing="1" cellpadding="1">
<tr>
<td width="33"><input name="button10" type="button" onClick="addChar(this.form.display, '8')" value=" 8 "></td>
</tr>
</table></td>
<td width="83" align="center"><table width="41" border="2" cellspacing="1" cellpadding="1">
<tr>
<td width="31"><input name="button12" type="button" onClick="addChar(this.form.display, '9')" value=" 9 "></td>
</tr>
</table></td>
<td width="67" align="center"><table width="42" border="2" cellspacing="1" cellpadding="1">
<tr>
<td width="32"><input name="button21" type="button" onClick="addChar(this.form.display, '/')" value=" / "></td>
</tr>
</table></td>
<td width="77" align="center"><table width="47" border="2" cellspacing="1" cellpadding="1">
<tr>
<td width="37"><input name="button" type="button" onClick="if(checkNum(this.form.display.value)) { cos(this.form) }" value="cos"></td>
</tr>
</table></td>
<td width="91" align="center"><table width="61" border="2" cellspacing="1" cellpadding="1">
<tr>
<td><input name="button6" type="button" onClick="if (checkNum(this.form.display.value)) { acos(this.form) }" value="arccos"></td>
</tr>
</table></td>
<td colspan="2" align="center" ><!--DWLayoutEmptyCell--> </td>
<td width="4" align="center"><!--DWLayoutEmptyCell--> </td>
<td width="3" align="center" ><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td align="center" height="40"><table width="48" border="2" cellspacing="1" cellpadding="1">
<tr>
<td width="38"><input name="button62" type="button" onClick="if (checkNum(this.form.display.value)) { log(this.form) }" value="Log"></td>
</tr>
</table></td>
<td align="center" ><table width="41" border="2" cellspacing="1" cellpadding="1">
<tr>
<td><input name="button25" type="button" onClick="addChar(this.form.display, '4')" value=" 4 "></td>
</tr>
</table></td>
<td><table width="41" border="2" cellspacing="1" cellpadding="1">
<tr>
<td width="31"><input name="button11" type="button" onClick="addChar(this.form.display, '5')" value=" 5 "></td>
</tr>
</table></td>
<td align="center"><table width="38" border="2" cellspacing="1" cellpadding="1">
<tr>
<td><input name="button14" type="button" onClick="addChar(this.form.display, '6')" value=" 6 "></td>
</tr>
</table></td>
<td align="center"><table width="43" border="2" cellspacing="1" cellpadding="1">
<tr>
<td width="33"><input name="button16" type="button" onClick="addChar(this.form.display, '*')" value=" * "></td>
</tr>
</table></td>
<td align="center"><table width="46" border="2" cellspacing="1" cellpadding="1">
<tr>
<td width="36"><input name="button2" type="button" onClick="if (checkNum(this.form.display.value)) { sin(this.form) }" value=" sin"></td>
</tr>
</table></td>
<td align="center"><table width="62" border="2" cellspacing="1" cellpadding="1">
<tr>
<td><input name="button22" type="button" onClick="if (checkNum(this.form.display.value)) { asin(this.form) }" value=" arcsin"></td>
</tr>
</table></td>
<td colspan="2" align="center" ><!--DWLayoutEmptyCell--> </td>
<td align="center"><!--DWLayoutEmptyCell--> </td>
<td align="center"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td align="center" height="40"><table width="41" border="2" cellspacing="1" cellpadding="1">
<tr>
<td width="31"><input name="button26" type="button" onClick="if (checkNum(this.form.display.value)) { sqrt(this.form) }" value="√"></td>
</tr>
</table></td>
<td align="center" ><table width="39" border="2" cellspacing="1" cellpadding="1">
<tr>
<td><input name="button27" type="button" onClick="addChar(this.form.display, '1')" value=" 1 "></td>
</tr>
</table></td>
<td><table width="43" border="2" cellspacing="1" cellpadding="1">
<tr>
<td width="33"><input name="button13" type="button" onClick="addChar(this.form.display, '2')" value=" 2 "></td>
</tr>
</table></td>
<td align="center"><table width="43" border="2" cellspacing="1" cellpadding="1">
<tr>
<td width="33"><input name="button15" type="button" onClick="addChar(this.form.display, '3')" value=" 3 "></td>
</tr>
</table></td>
<td align="center"><table width="41" border="2" cellspacing="1" cellpadding="1">
<tr>
<td width="31"><input name="button17" type="button" onClick="addChar(this.form.display, '-')" value=" - "></td>
</tr>
</table></td>
<td align="center"><table width="50" border="2" cellspacing="1" cellpadding="1">
<tr>
<td width="40"><input name="button3" type="button" onClick="if (checkNum(this.form.display.value)) { tan(this.form) }" value=" tan"></td>
</tr>
</table></td>
<td align="center"><table width="63" border="2" cellspacing="1" cellpadding="1">
<tr>
<td><input name="button32" type="button" onClick="if (checkNum(this.form.display.value)) { atan(this.form) }" value=" arctan"></td>
</tr>
</table></td>
<td colspan="2" align="center" ><!--DWLayoutEmptyCell--> </td>
<td align="center"><!--DWLayoutEmptyCell--> </td>
<td align="center" ><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td align="center" height="40"><table width="47" border="2" cellspacing="1" cellpadding="1">
<tr>
<td><input name="button28" type="button" onClick="if (checkNum(this.form.display.value)) { square(this.form) }" value=" SQ "></td>
</tr>
</table></td>
<td align="center" ><table width="43" border="2" cellspacing="1" cellpadding="1">
<tr>
<td width="33"><input name="button29" type="button" onClick="addChar(this.form.display, '0')" value=" 0 "></td>
</tr>
</table></td>
<td><table width="38" border="2" cellspacing="1" cellpadding="1">
<tr>
<td width="28"><input name="button18" type="button" onClick="addChar(this.form.display, '.')" value=" . "></td>
</tr>
</table></td>
<td align="center"><table width="50" border="2" cellspacing="1" cellpadding="1">
<tr>
<td height="28"><input name="button19" type="button" onClick="changeSign(this.form.display)" value=" +/- "></td>
</tr>
</table></td>
<td align="center"><table width="43" border="2" cellspacing="1" cellpadding="1">
<tr>
<td width="33"><input name="button20" type="button" onClick="addChar(this.form.display, '+')" value=" + "></td>
</tr>
</table></td>
<td align="center"><table width="40" border="2" cellspacing="1" cellpadding="1">
<tr>
<td width="30"><input name="button4" type="button" onClick="addChar(this.form.display, '(')" value=" ( "></td>
</tr>
</table></td>
<td align="center"><table width="43" border="2" cellspacing="1" cellpadding="1">
<tr>
<td width="33"><input name="button5" type="button" onClick="addChar(this.form.display, ')')" value=" ) "></td>
</tr>
</table></td>
<td width="4" align="center"><!--DWLayoutEmptyCell--> </td>
<td width="4"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td align="center" height="40"><table width="36" border="2" cellspacing="1" cellpadding="1">
<tr>
<td width="26"><input name="button7" type="button" onClick="this.form.display.value = 0 " value="C"></td>
</tr>
</table></td>
<td colspan="2" align="center"><table width="74" border="2" cellspacing="1" cellpadding="1">
<tr>
<td><input name="button8" type="button" onClick="deleteChar(this.form.display)" value="backspace"></td>
</tr>
</table></td>
<td align="center"><table width="36" border="2" cellspacing="1" cellpadding="1">
<tr>
<td width="48"><input name="enter" onClick="if (checkNum(this.form.display.value)) { compute(this.form) }" type="button" value="="></td>
</tr>
</table></td>
<td align="center"><table width="36" border="2" cellspacing="1" cellpadding="1">
<tr>
<td width="26"><input name="button63" type="button" onClick="addChar(this.form.display, '3,14')" value="π"></td>
</tr>
</table></td>
<td align="center"><table width="43" border="2" cellspacing="1" cellpadding="1">
<tr>
<td width="33" height="28"><input name="button52" type="button" onClick="if (checkNum(this.form.display.value)) { square(this.form) }" value="x^2"></td>
</tr>
</table></td>
<td align="center"><!--DWLayoutEmptyCell--> </td>
<td align="center"><!--DWLayoutEmptyCell--> </td>
<td></td>
<td></td>
<td> </td>
</tr>
<tr>
<td height="23" align="center"><!--DWLayoutEmptyCell--> </td>
<td align="center" colspan="4"><!--DWLayoutEmptyCell--> </td>
<td align="center"><!--DWLayoutEmptyCell--> </td>
<td align="center"><!--DWLayoutEmptyCell--> </td>
<td align="center"><!--DWLayoutEmptyCell--> </td>
<td></td>
<td></td>
<td> </td>
</tr>
</tbody>
</table>
</form>
<p align="center"> <div align="center"><a href="index.php">Menu Utama</a></div>
</html>