This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Jumat, 06 Januari 2012

UAS WEBPROG (membuat kalkulator servlet)



2.Buatlah New Project

 

3. Aktifkan Apache Tomcat
 

4. Pilihlah Java Web, lalu pilih Java Aplication




7. Secara Otomatis Project Kalkulator muncul dan siap digunkan

8. Berikut adalah source code yang dapat kita tulis di lembar kerja, lihat atas:

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Servlet Calculator</title>
    <h1><center>APLIKASI KALKULATOR</center></h1>
        <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);
}
function sin(form) {
form.display.value = Math.sin(form.display.value);
}
function tan(form) {
form.display.value = Math.tan(form.display.value);
}
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 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 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>
    </head>
    <body>
        <form NAME="sci-calc">
<center><TABLE CELLSPACING="0" CELLPADDING="1">
<TR>
    <td><label for="Indonesia">Hitung :</label></td>
<TD COLSPAN="5" ALIGN="center"><INPUT NAME="display"
VALUE="0" SIZE="20" MAXLENGTH="15"></TD>
</TR>
<TR>
<TD ALIGN="center"><INPUT TYPE="button" VALUE=" exp "
ONCLICK="if (checkNum(this.form.display.value)) {
exp(this.form) }"></TD>
<TD ALIGN="center"><INPUT TYPE="button" VALUE=" ln "
ONCLICK="if (checkNum(this.form.display.value)) {
ln(this.form) }"></TD>
<TD ALIGN="center"><INPUT TYPE="button" VALUE=" sq "
ONCLICK="if (checkNum(this.form.display.value)) {
square(this.form) }"></TD>
<TD ALIGN="center"><INPUT TYPE="button" VALUE=" (
" ONCLICK="addChar(this.form.display, '(')"></TD>
<TD ALIGN="center"><INPUT TYPE="button" VALUE=" ) "
ONCLICK="addChar(this.form.display, ')')"></TD>
</TR>
</tr>
<tr>
<TD ALIGN="center"><INPUT TYPE="button" VALUE=" sin"
ONCLICK="if (checkNum(this.form.display.value)) {
sin(this.form) }"></TD>
<TD ALIGN="center"><INPUT TYPE="button" VALUE=" 7 "
ONCLICK="addChar(this.form.display, '7')"></TD>
<TD ALIGN="center"><INPUT TYPE="button" VALUE=" 8 "
ONCLICK="addChar(this.form.display, '8')"></TD>
<TD ALIGN="center"><INPUT TYPE="button" VALUE=" 9 "
ONCLICK="addChar(this.form.display, '9')"></TD>
<TD ALIGN="center"><INPUT TYPE="button" VALUE=" ÷ "
ONCLICK="addChar(this.form.display, '/')"></TD>
</TR>
<tr>
<TD ALIGN="center"><INPUT TYPE="button" VALUE="cos"
ONCLICK="if (checkNum(this.form.display.value)) {
cos(this.form) }"></TD>
<TD ALIGN="center"><INPUT TYPE="button" VALUE=" 4 "
ONCLICK="addChar(this.form.display, '4')"></TD>
<TD ALIGN="center"><INPUT TYPE="button" VALUE=" 5 "
ONCLICK="addChar(this.form.display, '5')"></TD>
<TD ALIGN="center"><INPUT TYPE="button" VALUE=" 6 "
ONCLICK="addChar(this.form.display, '6')"></TD>
<TD ALIGN="center"><INPUT TYPE="button" VALUE=" * "
ONCLICK="addChar(this.form.display, '*')"></TD>
</TR>
<TR>
<TD ALIGN="center"><INPUT TYPE="button" VALUE=" tan"
ONCLICK="if (checkNum(this.form.display.value)) {
tan(this.form) }"></TD>
<TD ALIGN="center"><INPUT TYPE="button" VALUE=" 1 "
ONCLICK="addChar(this.form.display, '1')"></TD>
<TD ALIGN="center"><INPUT TYPE="button" VALUE=" 2 "
ONCLICK="addChar(this.form.display, '2')"></TD>
<TD ALIGN="center"><INPUT TYPE="button" VALUE=" 3 "
ONCLICK="addChar(this.form.display, '3')"></TD>
<TD ALIGN="center"><INPUT TYPE="button" VALUE=" - "
ONCLICK="addChar(this.form.display, '-')"></TD>
</TR>
<TR>
<TD ALIGN="center"><INPUT TYPE="button" VALUE=" sqrt "
ONCLICK="if (checkNum(this.form.display.value)) {
sqrt(this.form) }"></TD>
<TD ALIGN="center"><INPUT TYPE="button" VALUE=" 0 "
ONCLICK="addChar(this.form.display, '0')"></TD>
<TD ALIGN="center"><INPUT TYPE="button" VALUE=" . "
ONCLICK="addChar(this.form.display, '.')"></TD>
<TD ALIGN="center"><INPUT TYPE="button" VALUE=" +/- "
ONCLICK="changeSign(this.form.display)"></TD>
<TD ALIGN="center"><INPUT TYPE="button" VALUE=" + "
ONCLICK="addChar(this.form.display, '+')"></TD>
</TR>
<TR>
<TD ALIGN="center"><INPUT TYPE="button" VALUE="DEL"
ONCLICK="this.form.display.value = 0 "></TD>
<TD ALIGN="center" COLSPAN="3"><INPUT TYPE="button"
VALUE="BACKSPACE"
ONCLICK="deleteChar(this.form.display)"></TD>
<TD ALIGN="center"><INPUT TYPE="button" VALUE=" = "
NAME="enter" ONCLICK="if
(checkNum(this.form.display.value)) { compute(this.form)
}">
</TD>
</TR>
    </TABLE></center>
        </form>
        <br><br><br><br><br><br><br>
        <h2><center>UAS Praktikum Web Programmaing</center></h2>
        <p><center>
        <b>TI5A Multimedia</b><br>
        Oleh :<br>
        Lilis Syarifah-109091000055, Andi Faried Tenrigau-109091000045<br>
        Iindra Iriyanti-109091000087, Rinal Hafiz-109091000044
    </center></p>
        </body>
    </html>


9.Lalu pada bagian servlet kita isi dengan source code berikut

Rabu, 26 Oktober 2011

Membuat Data Base pada MySQL/PhpMyAdmin dan merelasikannya

Membuat database sekolah yang dimana setiap tabelnya memiliki relasi di setiap tabel
: Untuk mendownload tutorialnya klik di sini

cara membuat script PHP untuk menterjemahkan teks dari bahasa tertentu ke bahasa lain memanfaatkan Google Translate API.

Dengan script buatan sendiri ini, Anda tidak perlu lagi membuka situs Google Translate setiap kali akan menterjemahkan sebuah teks, namun cukup membuka aplikasi yang telah dibuat sendiri ini. Bahkan, Anda bisa menambahkan semacam widget di situs web Anda untuk layanan penterjemahan sembarang teks.

OK, sebelum kita mulai membuat script penterjemah teks ini, terlebih dahulu kita harus mengaktifkan API untuk Google Translate ini. Untuk mengaktifkan API ini, silakan Anda login ke https://code.google.com/apis/console/?api=translate menggunakan akun Google Anda. Jika belum memilikinya, maka silakan registrasi dahulu.
Setelah Anda berhasil login, maka akan muncul tampilan berikut ini jika sebelumnya belum pernah mengaktifkan Google API.
Google API Translate