blog ini berupa informasi berupa berbagai jenis coding dan membahas alat-alat komputer.

Choose Languange Here!

Friday, August 3, 2018

Membuat Kalkulator Dengan Notepad++

Assalamualaikum wr wb. Kembali Lagi Di Blog Saya! Pada Kesempatan Hari Ini Saya Akan Mengasih tau kalian cara membuat Kalkulator Dengan Notepad++. Saya Merekomendasikan Notepad++ Karena Kalau Memakai Notepad Biasa Kadang - Kadang Dia Error Atau Tidak Berjalan Command Nya.

Di Code Ini Biasanya Menggunakan Javascript pasti semua udh tau kan??. Oke Pertama-tama
buka Notepad++ lalu save as dengan mengetik file di pojok kiri atas kalau sudah pilih type files nya menjadi All Types. dan mengganti nama tersebut menjadi kalkulator.html atau seterah kalian.

ok ini lah code untuk membuat kalkulator:

<html>
<head>
<title>KALKULATOR by faqih</title>     

<script type="text/javascript">
function tambah(){
var num1 = document.myform.angka1.value;
var num2 = document.myform.angka2.value;
var pertambahan = parseInt(num1) + parseInt(num2);
document.getElementById('add').value = pertambahan;}
function kurang(){
var num1 = document.myform.angka1.value;
var num2 = document.myform.angka2.value;
var pengurangan = parseInt(num1) - parseInt(num2);
document.getElementById('add').value = pengurangan;}
function kali(){
var num1 = document.myform.angka1.value;
var num2 = document.myform.angka2.value;
var perkalian = parseInt(num1) * parseInt(num2);
document.getElementById('add').value = perkalian;}
function bagi(){
var num1 = document.myform.angka1.value;
var num2 = document.myform.angka2.value;
var pembagian = parseInt(num1) / parseInt(num2);
document.getElementById('add').value = pembagian;}
        </script>
</head>
<body>
<FORM NAME="myform">
<h1><b><center>KALKULATOR by faqih</center></b></h1><center><table border = "1">
<br></br>
Angka ke - 1 = <input type="text" name = "angka1">
<br></br>
Angka ke - 2 = <input type="text" name = "angka2">
<br></br>
Hasilnya     = <input type = "text" id = "add" name = "hasil" value= "">
<br></br>   
<INPUT TYPE="button" NAME="tambah1" Value="+" onClick="tambah()"/>
<INPUT TYPE="button" NAME="kurang1" Value="-" onClick="kurang()"/>
<INPUT TYPE="button" NAME="kali1" Value="x" onClick="kali()"/>
<INPUT TYPE="button" NAME="bagi1" Value=":" onClick="bagi()"/></table></center>
</FORM>
</body>
</html>

Dan Hasil Pun Akan Menjadi Gambar Seperti Ini:


ok terima kasih sudah mengkunjungi blog saya mudah-mudahan bermanfaat bagi yg masih pemula coding terima kasih wassalamualaikum wr wb.
Share:

1 comment:

  1. Kak, bisa enggak desain calculatornya mirip dengan gambar calculator asli?

    ReplyDelete

Powered by Blogger.

BTemplates.com

Tips Coding

=========-[Disclaimer]-=========

Disclaimer for Indonesia

If you require any more information or have any questions about our site's disclaimer, please feel free to contact us by email at iniakunfaqih@gmail.com

Disclaimers for faqih indonesia

All the information on this website - http://faqihfaqihindo.blogspot.com/ - is published in good faith and for general information purpose only. faqih indonesia does not make any warranties about the completeness, reliability and accuracy of this information. Any action you take upon the information you find on this website (faqih indonesia), is strictly at your own risk. faqih indonesia will not be liable for any losses and/or damages in connection with the use of our website.

From our website, you can visit other websites by following hyperlinks to such external sites. While we strive to provide only quality links to useful and ethical websites, we have no control over the content and nature of these sites. These links to other websites do not imply a recommendation for all the content found on these sites. Site owners and content may change without notice and may occur before we have the opportunity to remove a link which may have gone 'bad'.

Please be also aware that when you leave our website, other sites may have different privacy policies and terms which are beyond our control. Please be sure to check the Privacy Policies of these sites as well as their "Terms of Service" before engaging in any business or uploading any information.

Consent

By using our website, you hereby consent to our disclaimer and agree to its terms.

Update

Should we update, amend or make any changes to this document, those changes will be prominently posted here.

This Disclaimer was created at World's Free Disclaimer Generator.

Blogger templates