Professional Documents
Culture Documents
NIM : 061640831793
Kelas : 5 MIB
<body bgcolor="Navajowhite">
<center><h1><font color="blue" face="comic sans ms">OPERATOR
PERHITUNGAN</font></h1>
<tr bgcolor="white">
<td align="center" width="130px" height="60px">
<form action ="persegi panjang.jsp" method="get">
<input type="submit" style="background-color:lightgreen; font-
family:times new roman; width:200px; height:60px;" value="PERSEGI PANJANG">
</form>
</tr>
<tr bgcolor="white">
<td align="center" width="130px" height="60px">
<form action ="lingkaran.jsp" method="get">
<input type="submit" style="background-color:lightsalmon; font-
family:times new roman; width:200px; height:60px;" value="LINGKARAN">
</form>
</td>
</tr>
</table>
</center>
</body>
</html>
1
B. Output Index
2
I. OPERATOR DASAR
<body bgcolor="Lightskyblue">
<center><h1><font color="orangered" face="comic sans ms">Operator
Dasar</font></h1>
<tr bgcolor=#F0E68C>
<td align="center" width="130px" height="40">
<form action ="tambah.jsp" method="get">
Angka 1 : <input name="a" type="text" style="background-color:#FAF0E6 ;
text-align:center; width:100px; height:20px; border:1px"><br>
Angka 2 : <input name="b" type="text" style="background-color:#FAF0E6 ;
text-align:center; width:100px; height:20px; border:1px"><br><br>
<input type="submit" style="background-color:darkorange; font-weight:bold;
font-family:times new roman; font-size:16px; width:70px; height:30px;" value="+">
</form><br>
</td>
<td align="center" width="130px" height="40">
<form action ="kurang.jsp" method="get">
Angka 1 : <input name="a" type="text" style="background-color:#FAF0E6 ;
text-align:center;width:100px; height:20px; border:1px"><br>
Angka 2 : <input name="b" type="text" style="background-color:#FAF0E6 ;
text-align:center; width:100px; height:20px; border:1px"><br><br>
<input type="submit" style="background-color:darkorange; font-weight:bold;
font-family:times new roman; font-size:16px; width:70px; height:30px;" value="-">
</form><br>
</td>
</tr>
<tr bgcolor="orange"><th>Perkalian</th><th>Pembagian</th>
</tr>
<tr bgcolor=#F0E68C>
3
<td align="center" width="130px" height="40">
<form action ="kali.jsp" method="get">
Angka 1 : <input name="a" type="text" style="background-color:#FAF0E6 ;
text-align:center; width:100px; height:20px; border:1px"><br>
Angka 2 : <input name="b" type="text" style="background-color:#FAF0E6 ;
text-align:center; width:100px; height:20px; border:1px"><br><br>
<input type="submit" style="background-color:darkorange; font-weight:bold;
font-family:times new roman; font-size:16px; width:70px; height:30px;" value="*">
</form><br>
</td>
<td align="center" width="130px" height="40">
<form action ="bagi.jsp" method="get">
Angka 1 : <input name="a" type="text" style="background-color:#FAF0E6 ;
text-align:center; width:100px; height:20px; border:1px"><br>
Angka 2 : <input name="b" type="text" style="background-color:#FAF0E6 ;
text-align:center; width:100px; height:20px; border:1px"><br><br>
<input type="submit" style="background-color:darkorange; font-weight:bold;
font-family:times new roman; font-size:16px; width:70px; height:30px;" value="/">
</form><br>
</td>
</tr>
<tr bgcolor="orange"><th>Modulus</th></tr>
<tr bgcolor=#F0E68C>
<td align="center" width="130px" height="40">
<form action ="mod.jsp" method="get">
Angka 1 : <input name="a" type="text" style="background-color:#FAF0E6 ;
text-align:center; width:100px; height:20px; border:1px"><br>
Angka 2 : <input name="b" type="text" style="background-color:#FAF0E6 ;
text-align:center; width:100px; height:20px; border:1px"><br><br>
<input type="submit" style="background-color:darkorange; font-weight:bold;
font-family:times new roman; font-size:16px; width:70px; height:30px;" value="Mod">
</form><br>
</td>
<td align="center" width="130px" height="40">
<form action ="index.jsp" method="get">
<input type="submit" style="background-color:darkorange; font-
weight:bold; font-family:times new roman; font-size:13px; width:70px; height:50px;"
value="HOME">
</form><br>
</td>
</table>
</center>
</body>
</html>
4
B. Tampilan dari operator dasar.jsp
5
Operator Penjumlahan
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Penjumlahan</title>
</head>
<body bgcolor="Lightskyblue">
<center><h1><font color="orangered" face="comic sans
ms">Penjumlahan</font></h1>
<%
int a = Integer.parseInt(request.getParameter("a"));
int b = Integer.parseInt(request.getParameter("b"));
int c = a + b;
out.print("Nilai A adalah "+a);
out.print("<br>");
out.print("Nilai B adalah "+b);
out.print("<br>");
out.print("Hasil Penjumlahan adalah "+c);
%>
<br><br>
<table>
<tr>
<td align="center" width="120px" height="40">
<form action ="operator dasar.jsp" method="get">
<input type="submit" style="background-color:darkorange; font-
weight:bold; font-family:times new roman; font-size:13px; width:60px; height:30px;"
value="BACK">
</form>
</td>
<td align="center" width="120px" height="40">
<form action ="index.jsp" method="get">
<input type="submit" style="background-color:darkorange; font-
weight:bold; font-family:times new roman; font-size:13px; width:60px; height:30px;"
value="HOME">
</form>
</td>
</tr>
</table>
</center>
</body>
</html>
6
Tampilan hasil penjumlahan:
Operator Pengurangan
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Pengurangan</title>
</head>
<body bgcolor="Lightskyblue">
<center><h1><font color="orangered" face="comic sans
ms">Pengurangan</font></h1>
<%
int a = Integer.parseInt(request.getParameter("a"));
int b = Integer.parseInt(request.getParameter("b"));
int c = a - b;
out.print("Nilai A adalah "+a);
out.print("<br>");
out.print("Nilai B adalah "+b);
out.print("<br>");
out.print("Hasil Pengurangan adalah "+c);
%>
<br><br>
<table>
<tr>
<td align="center" width="120px" height="40">
<form action ="operator dasar.jsp" method="get">
<input type="submit" style="background-color:darkorange; font-
weight:bold; font-family:times new roman; font-size:13px; width:60px; height:30px;"
value="BACK">
</form>
</td>
<td align="center" width="120px" height="40">
<form action ="index.jsp" method="get">
<input type="submit" style="background-color:darkorange; font-
weight:bold; font-family:times new roman; font-size:13px; width:60px; height:30px;"
value="HOME">
</form>
</td>
</tr>
7
</table>
</center>
</body>
</html>
Operator Perkalian
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Perkalian</title>
</head>
<body bgcolor="Lightskyblue">
<center><h1><font color="orangered" face="comic sans
ms">Perkalian</font></h1>
<%
int a = Integer.parseInt(request.getParameter("a"));
int b = Integer.parseInt(request.getParameter("b"));
int c = a * b;
out.print("Nilai A adalah "+a);
out.print("<br>");
out.print("Nilai B adalah "+b);
out.print("<br>");
out.print("Hasil Perkalian adalah "+c);
%>
<br><br>
<table>
<tr>
<td align="center" width="120px" height="40">
<form action ="operator dasar.jsp" method="get">
<input type="submit" style="background-color:darkorange; font-
weight:bold; font-family:times new roman; font-size:13px; width:60px; height:30px;"
value="BACK">
</form>
</td>
<td align="center" width="120px" height="40">
<form action ="index.jsp" method="get">
8
<input type="submit" style="background-color:darkorange; font-
weight:bold; font-family:times new roman; font-size:13px; width:60px; height:30px;"
value="HOME">
</form>
</td>
</tr>
</table>
</center>
</body>
</html>
Operator Pembagian
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Pembagian</title>
</head>
<body bgcolor="Lightskyblue">
<center><h1><font color="orangered" face="comic sans
ms">Pembagian</font></h1>
<%
int a = Integer.parseInt(request.getParameter("a"));
int b = Integer.parseInt(request.getParameter("b"));
int c = a / b;
out.print("Nilai A adalah "+a);
out.print("<br>");
out.print("Nilai B adalah "+b);
out.print("<br>");
out.print("Hasil Pembagian adalah "+c);
%>
<br><br>
<table>
<tr>
<td align="center" width="120px" height="40">
<form action ="operator dasar.jsp" method="get">
9
<input type="submit" style="background-color:darkorange; font-
weight:bold; font-family:times new roman; font-size:13px; width:60px; height:30px;"
value="BACK">
</form>
</td>
<td align="center" width="120px" height="40">
<form action ="index.jsp" method="get">
<input type="submit" style="background-color:darkorange; font-
weight:bold; font-family:times new roman; font-size:13px; width:60px; height:30px;"
value="HOME">
</form>
</td>
</tr>
</table>
</center>
</body>
</html>
10
<br><br>
<table>
<tr>
<td align="center" width="120px" height="40">
<form action ="operator dasar.jsp" method="get">
<input type="submit" style="background-color:darkorange; font-
weight:bold; font-family:times new roman; font-size:13px; width:60px; height:30px;"
value="BACK">
</form>
</td>
<td align="center" width="120px" height="40">
<form action ="index.jsp" method="get">
<input type="submit" style="background-color:darkorange; font-
weight:bold; font-family:times new roman; font-size:13px; width:60px; height:30px;"
value="HOME">
</form>
</td>
</tr>
</table>
</center>
</body>
</html>
11
II. PERSEGI PANJANG
<body bgcolor="lightgreen">
<center><h1><font color="orangered" face="comic sans ms">Persegi
Panjang</font></h1>
<tr bgcolor=#F0E68C>
<td align="center" width="130px" height="40">
<form action ="luasPP.jsp" method="get">
Panjang : <input name="p" type="text" style="background-color:#FAF0E6 ;
text-align:center; width:100px; height:20px; border:1px"><br>
Lebar : <input name="l" type="text" style="background-color:#FAF0E6 ;
text-align:center; width:100px; height:20px; border:1px"><br><br>
<input type="submit" style="background-color:darkorange; font-weight:bold;
font-family:times new roman; font-size:16px; width:70px; height:30px;" value="Luas">
</form>
</td>
<td align="center" width="130px" height="40">
<form action ="kurang.jsp" method="get">
Panjang : <input name="p" type="text" style="background-color:#FAF0E6 ;
text-align:center;width:100px; height:20px; border:1px"><br>
Lebar : <input name="l" type="text" style="background-color:#FAF0E6 ;
text-align:center; width:100px; height:20px; border:1px"><br><br>
<input type="submit" style="background-color:darkorange; font-weight:bold;
font-family:times new roman; font-size:16px; width:70px; height:30px;"
value="Keliling">
</form>
</td>
</tr>
</table>
<br>
<form action ="index.jsp" method="get">
12
<input type="submit" style="background-color:darkorange; font-weight:bold;
font-family:times new roman; font-size:13px; width:70px; height:40px;"
value="HOME">
</form>
</center>
</body>
</html>
13
out.print("Panjang adalah "+p);
out.print("<br>");
out.print("Lebar adalah "+l);
out.print("<br>");
out.print("Luas Persegi Panjang adalah "+L);
%>
<br><br>
<table>
<tr>
<td align="center" width="120px" height="40">
<form action ="persegi panjang.jsp" method="get">
<input type="submit" style="background-color:darkorange; font-
weight:bold; font-family:times new roman; font-size:13px; width:60px; height:30px;"
value="BACK">
</form>
</td>
<td align="center" width="120px" height="40">
<form action ="index.jsp" method="get">
<input type="submit" style="background-color:darkorange; font-
weight:bold; font-family:times new roman; font-size:13px; width:60px; height:30px;"
value="HOME">
</form>
</td>
</tr>
</table>
</center>
</body>
</html>
<br><br>
<table>
<tr>
<td align="center" width="120px" height="40">
<form action ="persegi panjang.jsp" method="get">
<input type="submit" style="background-color:darkorange; font-
weight:bold; font-family:times new roman; font-size:13px; width:60px; height:30px;"
value="BACK">
</form>
</td>
<td align="center" width="120px" height="40">
<form action ="index.jsp" method="get">
<input type="submit" style="background-color:darkorange; font-
weight:bold; font-family:times new roman; font-size:13px; width:60px; height:30px;"
value="HOME">
</form>
</td>
</tr>
</table>
</center>
</body>
</html>
15
III. LINGKARAN
<body bgcolor="lightsalmon">
<center><h1><font color="brown" face="comic sans ms">Lingkaran</font></h1>
<tr bgcolor=#F0E68C>
<td align="center" width="130px" height="40">
<form action ="luasL.jsp" method="get">
Jari-jari : <input name="r" type="text" style="background-color:#FAF0E6
; text-align:center; width:100px; height:20px; border:1px"><br><br>
<input type="submit" style="background-color:darkorange; font-
weight:bold; font-family:times new roman; font-size:16px; width:70px; height:30px;"
value="Luas">
</form>
</td>
<td align="center" width="130px" height="40">
<form action ="kelilingL.jsp" method="get">
Jari-jari : <input name="r" type="text" style="background-color:#FAF0E6
; text-align:center; width:100px; height:20px; border:1px"><br><br>
<input type="submit" style="background-color:darkorange; font-
weight:bold; font-family:times new roman; font-size:16px; width:70px; height:30px;"
value="Keliling">
</form>
</td>
</tr>
</table>
<br>
<form action ="index.jsp" method="get">
<input type="submit" style="background-color:darkorange; font-weight:bold;
font-family:times new roman; font-size:13px; width:70px; height:40px;"
value="HOME">
</form>
16
</center>
</body>
</html>
Luas Lingkaran
Kode untuk menghitung luas lingkaran “luasL.jsp”
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Luas Lingkaran</title>
</head>
<body bgcolor="lightsalmon">
<center><h1><font color="red" face="comic sans ms">Luas
Lingkaran</font></h1>
<%
int r = Integer.parseInt(request.getParameter("r"));
double phi = 3.14;
double L = phi * r * r;
out.print("Jari-jari adalah "+r);
out.print("<br>");
out.print("Luas Lingkaran adalah "+L);
%>
17
<br><br>
<table>
<tr>
<td align="center" width="120px" height="40">
<form action ="lingkaran.jsp" method="get">
<input type="submit" style="background-color:darkorange; font-
weight:bold; font-family:times new roman; font-size:13px; width:60px; height:30px;"
value="BACK">
</form>
</td>
<td align="center" width="120px" height="40">
<form action ="index.jsp" method="get">
<input type="submit" style="background-color:darkorange; font-
weight:bold; font-family:times new roman; font-size:13px; width:60px; height:30px;"
value="HOME">
</form>
</td>
</tr>
</table>
</center>
</body>
</html>
Keliling Lingkaran
Kode untuk menghitung keliling lingkaran “kelilingL.jsp”
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Keliling Lingkaran</title>
</head>
<body bgcolor="lightsalmon">
<center><h1><font color="red" face="comic sans ms">Keliling
Lingkaran</font></h1>
<%
int r = Integer.parseInt(request.getParameter("r"));
double phi = 3.14;
double K = 2 * phi* r;
out.print("Jari-jari adalah "+r);
18
out.print("<br>");
out.print("Keliling Lingkaran adalah "+K);
%>
<br><br>
<table>
<tr>
<td align="center" width="120px" height="40">
<form action ="lingkaran.jsp" method="get">
<input type="submit" style="background-color:darkorange; font-
weight:bold; font-family:times new roman; font-size:13px; width:60px;
height:30px;" value="BACK">
</form>
</td>
<td align="center" width="120px" height="40">
<form action ="index.jsp" method="get">
<input type="submit" style="background-color:darkorange; font-
weight:bold; font-family:times new roman; font-size:13px; width:60px;
height:30px;" value="HOME">
</form>
</td>
</tr>
</table>
</center>
</body>
</html>
19