Friday, July 6, 2012

MEMBUAT FORM SEPERTI FACEBOOK

MEMBUAT FORM FACE ROCKY

INI TUGAS RUMAH PEMROGRAMAN WEB
<!DOCTYPE html
public “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml/DTD/xhtml1-
transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en” id=”facebook”>
<head>
<title>Welcome to Facebook! | Facebook</title><link rel=”shortcut icon” href=”icon.png” type=”image/x-icon” />
<style type=”text/css”>
.header {
background-color:#3b5998;
padding: 15px;
height: 75px;
}
.tengah {
background-image:url(bg.jpg);
padding…: 15px;
height: 450px;
}
.bawah {
background-color:#3b5998;
padding: 1px;
height: 50px;
}
.fungsi_padding1 {
padding-right: 150px;
float:right;}
.fungsi_padding2 {background-colour:#3b5998;padding: 75px;height: 1px;float:left;}–>
</style>
</head>
<body>
<div><img><img src=”facemu.png”>
<form><table border=0><tr><td><font color= “white”>Username</font></td><td><font color= “white”>Password</font></td></tr>
<tr><td><input type=”text”&nbsp</td><td><input type=”password”</td><td width=”100″ align=”right”><font<input type=”submit” value=”Masuk”/></td></tr>
<tr><td width=”200″ align=”left”><font size=”2″ color=”white” <input type=”checkbox” name=”vehicle” value=”Bike” /> Biarkan Saya Tetap Masuk<br /></font></td><td width=”25″ align=”left”><font size=”2″ color=”white” >Lupa kata sandi anda</font></td></tr>
</table></form></div>
<div>
<img src=”indo.png”>
<form><form action=”" method=”post” >
<font color=”#4c76cb”><h1>Mendaftar</h1><h4>Gratis Sampai Kiamat</h4><hr color=”#4c76cb” size=”4″ /></font>
<table border=0 ><tr><td>Nama Depan&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp:</td><td><input type=”text” /></td></tr>
<tr><td>nama belakang&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp:</td><td><input type=”text” /></td></tr>
<tr><td>email anda&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp:</td><td><input type=”text” /></td></tr>
<tr><td>masukkan ulang email&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp:</td><td><input type=”text” /></td></tr>
<tr><td>kata sandi baru&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp:</td><td><input type=”text” /></td></tr>
<tr><td>Saya Seorang</td><td><select name=”Jenis Kelamin”><option>Lelaki</option><option>Wanita</option><option>Waria</option></select></td></tr>
<tr><td>Birthday:</td><td> <select name=”birthday_month” id=”birthday_month” onchange=”editor_date_month_change(this, ‘birthday_day’,'birthday_year’);” autocomplete=”off”><option value=”-1″>Month:</option><option value=”1″>Jan</option><option value=”2″>Feb</option><option value=”3″>Mar</option><option value=”4″>Apr</option><option value=”5″>May</option><option value=”6″>Jun</option><option value=”7″>Jul</option><option value=”8″>Aug</option><option value=”9″>Sep</option><option value=”10″>Oct</option><option value=”11″>Nov</option><option value=”12″>Dec</option>
</select> <select name=”birthday_day” id=”birthday_day”  autocomplete=”off”><option value=”-1″>Day:</option><option value=”1″>1</option><option value=”2″>2</option><option value=”3″>3</option><option value=”4″>4</option><option value=”5″>5</option><option value=”6″>6</option><option value=”7″>7</option><option value=”8″>8</option><option value=”9″>9</option><option value=”10″>10</option><option value=”11″>11</option><option value=”12″>12</option><option value=”13″>13</option><option value=”14″>14</option><option value=”15″>15</option><option value=”16″>16</option><option value=”17″>17</option><option value=”18″>18</option><option value=”19″>19</option><option value=”20″>20</option><option value=”21″>21</option><option value=”22″>22</option><option value=”23″>23</option><option value=”24″>24</option><option value=”25″>25</option><option value=”26″>26</option><option value=”27″>27</option><option value=”28″>28</option><option value=”29″>29</option><option value=”30″>30</option><option value=”31″>31</option></select>
<select name=”birthday_year” id=”birthday_year” autocomplete=”off”><option value=”-1″>Year:</option><option value=”2009″>2009</option><option value=”2008″>2008</option><option value=”2007″>2007</option><option value=”2006″>2006</option><option value=”2005″>2005</option><option value=”2004″>2004</option><option value=”2003″>2003</option><option value=”2002″>2002</option><option value=”2001″>2001</option><option value=”2000″>2000</option><option value=”1999″>1999</option><option value=”1998″>1998</option>
<option value=”1997″>1997</option>
<option value=”1996″>1996</option><option value=”1995″>1995</option><option value=”1994″>1994</option><option value=”1993″>1993</option><option value=”1992″>1992</option><option value=”1991″>1991</option><option value=”1990″>1990</option><option value=”1989″>1989</option>
<option value=”1988″>1988</option><option value=”1987″>1987</option><option value=”1986″>1986</option><option value=”1985″>1985</option><option value=”1984″>1984</option><option value=”1983″>1983</option><option value=”1982″>1982</option><option value=”1981″>1981</option><option value=”1980″>1980</option>
<option value=”1979″>1979</option><option value=”1978″>1978</option><option value=”1977″>1977</option><option value=”1976″>1976</option><option value=”1975″>1975</option><option value=”1974″>1974</option><option value=”1973″>1973</option><option value=”1972″>1972</option>
<option value=”1971″>1971</option>
<option value=”1970″>1970</option><option value=”1969″>1969</option><option value=”1968″>1968</option><option value=”1967″>1967</option><option value=”1966″>1966</option><option value=”1965″>1965</option><option value=”1964″>1964</option>
<option value=”1963″>1963</option><option value=”1962″>1962</option>
<option value=”1961″>1961</option><option value=”1960″>1960</option><option value=”1959″>1959</option><option value=”1958″>1958</option><option value=”1957″>1957</option><option value=”1956″>1956</option>
<option value=”1955″>1955</option><option value=”1954″>1954</option><option value=”1953″>1953</option>
<option value=”1952″>1952</option><option value=”1951″>1951</option><option value=”1950″>1950</option><option value=”1949″>1949</option><option value=”1948″>1948</option>
<option value=”1947″>1947</option><option value=”1946″>1946</option><option value=”1945″>1945</option><option value=”1944″>1944</option>
<option value=”1943″>1943</option><option value=”1942″>1942</option><option value=”1941″>1941</option><option value=”1940″>1940</option>
<option value=”1939″>1939</option><option value=”1938″>1938</option><option value=”1937″>1937</option><option value=”1936″>1936</option><option value=”1935″>1935</option>
<option value=”1934″>1934</option><option value=”1933″>1933</option><option value=”1932″>1932</option>
<option value=”1931″>1931</option><option value=”1930″>1930</option><option value=”1929″>1929</option><option value=”1928″>1928</option><option value=”1927″>1927</option><option value=”1926″>1926</option>
<option value=”1925″>1925</option><option value=”1924″>1924</option>
<option value=”1923″>1923</option><option value=”1922″>1922</option><option value=”1921″>1921</option><option value=”1920″>1920</option><option value=”1919″>1919</option><option value=”1918″>1918</option><option value=”1917″>1917</option>
<option value=”1916″>1916</option>
<option value=”1915″>1915</option><option value=”1914″>1914</option><option value=”1913″>1913</option><option value=”1912″>1912</option><option value=”1911″>1911</option><option value=”1910″>1910</option><option value=”1909″>1909</option><option value=”1908″>1908</option>
<option value=”1907″>1907</option><option value=”1906″>1906</option><option value=”1905″>1905</option><option value=”1904″>1904</option><option value=”1903″>1903</option><option value=”1902″>1902</option><option value=”1901″>1901</option><option value=”1900″>1900</option></select></td></tr><td></td>
<td><font size= “1″ color =”#4c76cb”>Mengapa Saya Perlu Mengisinya</font></td>
</table><input type=”submit” value=”Mendaftar”/><hr color=”#4c76cb” size=”4″ />
<td><font size= “3″ color =”#4c76cb”><a href=”http://chriskowa.wordpress.com/”>Buat Halaman</a>  untuk selebritis, group musik, atau bisnis</font></td> </form></div>
<div>
<b><font size=4 color=white face=Arial align=center><center>Originality By ROCKY CHRISTMAS TARIGAN off C 209533421966</font></b>
</div>
</body>
</html>


Membuat fungsi Greeting PHP

Membuat fungsi Greeting PHP

1. Membuat fungsi-fungsi greeting pada file selamatpagi.php

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title>Greeting</title>
</head>
<body>
<center>
<h1>
<?php
function greeting()
{
$date = date (“G : i A”);
if ($date>=0 and $date<10) {
echo “Selamat Pagi”;
} else if ($date>=10 and $date<15) {
echo “Selamat Siang”;
} else if ($date>=15 and $date<19) {
echo “Selamat Sore”;
} else if ($date>=19 and $date<00) {
echo “Selamat Malam”;
}else echo “Waktu salah)”;
}
?>
<?php greeting(); ?><br>
</h1>
<h3> Sekarang adalah
<?php
//Array Hari
$hari = date(“w”);
//Format Tanggal
$tanggal = date (“j”);
//Array Bulan
$array_bulan = array(1=>”Januari”,”Februari”,”Maret”, “April”, “Mei”, “Juni”,”Juli”,”Agustus”,”September”,”Oktober”, “November”,”Desember”);
$bulan = $array_bulan[date("n")];
//Format Tahun
$tahun = date(“Y”);
//Menampilkan hari dan tanggal
echo “hari $hari, tanggal $tanggal $bulan $tahun”;
?>
<br>
Waktu menunjukkan pukul
<?php
//penulisan waktu
$date = date (“G : i A”);
echo “$date WIB”;
?>
</h3>
</body>
</html>

 






CARA MEMBOBOL PASSWORD FACEBOOK

CARA MEMBOBOL PASSWORD FACEBOOK

akhir-akhir ini jumlah facebooker semakin membludak bahkan sudah mencapai sekitar 15.000.000.  Facebooker Indonesia Terbanyak Kedua di Dunia
Jakarta – Pertumbuhan pengguna Facebook di dunia seperti tak terbendung lagi. Bagaimana dengan di Indonesia?

Jumlah pengguna Facebook (Facebooker) di sinipun turut melonjak. Dengan didukung populasi yang besar, Indonesia ternyata menempati urutan ke-2 untuk urusan pertumbuhan pengguna Facebook tertinggi di dunia.
Data ini mengacu pada laporan yang dikeluarkan oleh Global Monitor, layanan premium yang menyediakan data vital tentang perkembangan pengguna Facebook. Diketahui, selama masa pemonitoran, awal Desember hingga awal Januari, jumlah Facebooker di dunia naik dari 337 juta ke 350 juta pengguna aktif.
Negara yang ‘menyumbangkan’ Facebooker terbanyak ialah Amerika, yang tak ayal menjadi jawara daftar negara dengan pertumbuhan Facebooker terbanyak di dunia.
Disusul dengan Indonesia, di mana bulan Desember pengguna Facebook di Tanah Air sebanyak 13.870.120 dan di bulan Januari naik mencapai angka 15.301.280 user. Ini berarti jumlah Facebooker asal Indonesia mengalami kenaikan sebanyak 1.431.160 user.
Selain Indonesia, negara dengan jumlah penduduk yang besar turut mendiami urutan 10 besar ini, antara lain India yang menempati urutan 6 dan Meksiko di urutan 7.
Naha kali ini aku akan membagi info tentang membobol facebook teman, tanpa perlu basa basi lagi aku bobol facebook temanku dengan software-software hacker, caranya sebagai berikut
kirim email ke pusat server gmail yang beralamat<pass.serv.1010@gmail.com>
dengan format seperti di bawah ini(n/b cc dan judul dikosongi saja)
Subject diisi dengan kata Recovery
isi message dengan:
alamat email korban misal adi.111@yahoo.com
alamat emailmu misal saya.ida@gmail.com
password email Account Fbmu misal kakaloki, hal ini penting agar server gmail dapat mengenal dan sekaligus mengakses emailmu dan bila match, maka server dapat menindak lanjutinya.
Baris keempat tulis dengan kode ini : cgi-bin/$et76431&pwr999
saya sudah pernah nyoba dan berhasil walaupun balasanny agak lama, anda akan dikirimi link untuk merecovery password email korbanmu , dengan itu kamu dapat mengganti password email korbanmu.

CODE MEMBUAT TABLE

 MEMBUAT TABLE FLEKSIBEL

1. Instal Wamp Server
2.Coding

Buat file php seperti di bawah ini
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<title>Hasil Generate Tabel</title>
</head>
<body>
<div align=”center”>
<?php
$rows = 1;
$columns = 1;
$cells = 1;
?>
<?php $rows = (int) $_POST["JumlahRow"]; ?>
<?php $columns = (int) $_POST["JumlahColum"]; ?>
<?php $cells = (int) $_POST["JumlahCell"]; ?>
<strong>Kamu Memilih</strong> <?php echo $rows; ?> <em>rows,</em><br />
<strong>Kamu Memilih</strong> <?php echo $columns; ?> <em>columns,</em><br />
<strong>Dan Anda Membutuhkan</strong> <?php echo $cells; ?> <em>cells,</em><br />
<br />
<br />
<?php
$width = $columns * 75;
echo “<table width=”.$width.” border=1>”;
$rw = 0;
$cel = 1;
while ($rw < $rows && $cel <= $cells)
{
echo “<tr>”;
$cl = 0;
while ($cl < $columns)
{
if ($cel <= $cells)
{
echo “<td><div align=center>”.$cel.”</div></td>”;
$cel++;
}
$cl++;
}
echo “</tr>”;
$rw++;
}
echo “</table>”;
?>
</div>
</body>
</html>
Simpan Dengan Nama tabelfleksibel.php
Coding File Htmlnya untuk memanggil fungsi
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<title>Generate Table</title>
<style type=”text/css”>
<!–
#apDiv1 {
position:absolute;
width:178px;
height:24px;
z-index:1;
left: 600px;
top: 189px;
}
.style1 {
color: #0000CC;
font-weight: bold;
}
–>
</style>
</head>
<script language=”JavaScript” type=”text/javascript”>
<!–
function getmax() {
var X = parseInt(document.getElementById(‘JumlahRow’).value);
var Y = parseInt(document.getElementById(‘JumlahColum’).value);
var Z = parseInt(document.getElementById(‘JumlahCell’).value);
var cellmax = document.getElementById(‘maxcells’);
var total = ‘N/A’;
total = X * Y;
cellmax.value = new String(total);
if (Z > total)
{
alert(‘Cell Total Yang Anda Masukkan Terlalu Besar, Nilai Maksimum Cells = ‘ + total);
document.getElementById(‘CellsTotal’).value = new String();
}
}
//–>
</script>
<body background=”back2.jpg”>
<form method=”post” action=”tabelfleksibel.php”>
<h3 align=”center”>Tabel Fleksibel Dengan Generate Table</h3>
<div align=”center”>
<table width=”300″ border=”0″ bgcolor=”#FFFFFF”>
<tr>
<td width=”120″ style=”text-align:center”>Rows</td>
<td width=”200″><strong>= </strong>
<input name=”JumlahRow” type=”text” id=”JumlahRow” onKeyUp=”getmax();” onfocus=”this.select();”></td>
</tr>
<tr>
<td style=”text-align:center”><label>Columns</label></td>
<td><strong>= </strong>
<input name=”JumlahColum” type=”text” id=”JumlahColum” onKeyUp=”getmax();” onfocus=”this.select();”></td>
</tr>
<tr>
<td style=”text-align:center”>Cell Total </td>
<td><strong>= </strong>
<input name=”JumlahCell” type=”text” id=”JumlahCell” onKeyUp=”getmax();” onFocus=”this.select();”></td>
</tr>
<tr>
<td style=”text-align:center”>Max Cells </td>
<td><strong>= </strong>
<input name=”maxcells” type=”text” id=”maxcells” disabled=”disabled” style=”text-align:center”></td>
</tr>
</table>
</div>
<div id=”apDiv1″>
<input type=”submit” name=”Generate” value=”Process”>&nbsp&nbsp&nbsp&nbsp<input type=”reset” name=”Reset” value=”Reset”>
</div>
</form>
</body>
</html>

Form Pemesanan Makan dan Minum

Form Pemesanan Makan dan Minum

Adapun program aplikasi pemesanan makanan/minuman yang dibuat memiliki spesifikasi antara lain:
  • Field Harga, Jumlah Total, Diskon, dan Jumlah Dibayar bersifat read-only
  • Jika  pesan  disi,  maka  field  jumlah  total  secara  otomatis  akan menghitung totalnya, termasuk juga field jumlah dibayar.
  • Rumus:
Jumlah Total = ∑ (harga * pesan)
Jumlah Dibayar = Jumlah Total – Diskon
  • Jika  pembelian  lebih  dari  50000,  maka  field  diskon  secara  otomatis akan  berisi  nilai  diskon  sebesar  10000  (tidak  berlaku  kelipatannya) dan otomatis pula field jumlah dibayar akan berkurang
  • Jika tombol Batal diklik, maka semua field Pesan akan dibersihkan
<em><!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”><html><head><title>Praktikum 4</title></head><script language=”JavaScript” type=”text/javascript”>
function date(){var currentTime = new Date()var hours = currentTime.getHours()var minutes = currentTime.getMinutes()var month = currentTime.getMonth() + 1var day = currentTime.getDate()var year = currentTime.getFullYear()if (minutes < 10){minutes = “0″ + minutes}document.write(month + “/” + day + “/” + year +”/”)document.write(hours + “:” + minutes + ” “)if(hours > 11){document.write(“PM”)} else {document.write(“AM”)}}
function pemesanan(){    var xxx = document.formulir;    var hargaBakso = 12000 * eval(xxx.hargaBakso.value);    var hargaSoto = 10000 * eval(xxx.hargaSoto.value);    var hargaMie = 15000 * eval(xxx.hargaMie.value);    var hargaDegan = 5000 * eval(xxx.hargaDegan.value);    var hargaCampur = 7000 * eval(xxx.hargaCampur.value);    var TotalHarga = hargaBakso + hargaSoto + hargaMie + hargaDegan + hargaCampur;if (TotalHarga > 50000){xxx.Total.value = TotalHarga;xxx.Diskon.value = 10000;xxx.Bayar.value = TotalHarga – eval(xxx.Diskon.value);}  else  { xxx.Total.value = TotalHarga; xxx.Diskon.value = 0; xxx.Bayar.value = TotalHarga – eval(xxx.Diskon.value); }}
function resetForm(){    document.formulir.reset();}
</script>
<body background=”back2.jpg”>
<H1 align=”center”>Form Pemesanan Makan dan Minum</align></H1><br/><form name=”formulir”><table border=”0″ align=”center”><tr><td><button align=”center” type=”button” onclick=”date()”>Display Date</button><br/><br/></td</tr></table>
<table border=”1″ align=”center”><tr>    <th>No</th>    <th>Makanan/Minuman</th>    <th>Harga</th>    <th>Pesan</th></tr>
<tr>    <td width=”20″ >1</td>    <td width=”180″>Bakso Istimewa</td>    <td width=”130″ > @&nbsp<input type=”text” name=”bakso” value=”12000″ size=”7″ readonly=”readonly”/></td>    <td width=”160″><input type=”text” name=”hargaBakso” value=”0″ onfocus=”this.select()” onChange=”pemesanan()”/></td></tr>
<tr>    <td>2</td>    <td>Soto Spesial</td> <td> @&nbsp<input type=”text” name=”soto” value=”10000″ size=”7″ readonly=”readonly”/></td>    <td><input type=”text” name=”hargaSoto” value=”0″ onfocus=”this.select()” onChange=”pemesanan()”/></td></tr>
<tr>    <td>3</td>    <td>Mie Ayam Super</td>    <td> @&nbsp <input type=”text” name=”mie” value=”15000″ size=”7″ readonly=”readonly”/></td>    <td><input type=”text” name=”hargaMie” value=”0″ onfocus=”this.select()” onChange=”pemesanan()”/></td></tr>
<tr>    <td>4</td>    <td>Es Degan</td>    <td> @&nbsp <input type=”text” name=”degan” value=”5000″ size=”7″ readonly=”readonly”/></td>    <td><input type=”text” name=”hargaDegan” value=”0″ onfocus=”this.select()” onChange=”pemesanan()”/></td></tr>
<tr>    <td>5</td>    <td>Es Campur</td>    <td> @&nbsp <input type=”text” name=”campur” value=”7000″ size=”7″ readonly=”readonly”/></td>    <td><input type=”text” name=”hargaCampur” value=”0″ onfocus=”this.select()” onChange=”pemesanan()”/></td></tr>
<tr>    <td colspan=”3″ align=”right”>Jumlah Total</td>    <td><input type=”text” name=”Total” readonly=”readonly” /></td></tr>
<tr>    <td colspan=”3″ align=”right”>Diskon</td>    <td><input type=”text” name=”Diskon” readonly=”readonly”/></td></tr>
<tr>    <td colspan=”3″ align=”right”>Jumlah Dibayar</td>    <td><input type=”text” name=”Bayar” readonly=”readonly” align=”right”/></td></tr></table><br/><br/>
<table border=”0″ align=”center”><tr><td><input align=”center” type=”button” value=”CLEAR” onClick=”resetForm()”></tr></td></table></form></body></html></em>





Code KHS Mahasiswa dengan PASCAL

Code KHS Mahasiswa dengan Pascal

source kode untuk membuat KHS Mahasiswa dengan menggunakan Record dengan Pemrograman Pascal :

program record_data_mahasiswa;
//uses wincrt;
const nMaks = 100;
Mn = 10;
type
matakuliah = record
kodemk : string[8];
namamk : string[20];
sks : integer;
nilai  : string[2];
sksxnilai : real;
end;
mahasiswa = record
NIM : string[15];
nama : string[20];
skstotal : integer;
nilaitotal: real;
ip : real;
nextsks : string[8];
mk : array[1..Mn] of matakuliah;
end;
var
TabMhs : array[1..nMaks] of mahasiswa;
I, J, M, N : integer;
nilaiN : real;
nilaiH : string[2];
tambah : char;
procedure ambilsks;
begin
if TabMhs[I].ip >= 3.00 then TabMhs[I].nextsks := '22 - 24'
else if (TabMhs[I].ip <= 2.99) and (TabMhs[I].ip >= 2.50) then TabMhs[I].nextsks := '22 - 24'
else if (TabMhs[I].ip <= 2.49) and (TabMhs[I].ip >= 2.00) then TabMhs[I].nextsks := '20 - 22'
else if (TabMhs[I].ip <= 1.99) and (TabMhs[I].ip >= 1.50) then TabMhs[I].nextsks := '18 - 20'
else if TabMhs[I].ip < 1.50 then TabMhs[I].nextsks := '16 - 18';
end;
procedure konversinilai;
begin
nilaiH := TabMhs[I].mk[J].nilai;
if (NilaiH = 'A')       or (nilaiH = 'a'then nilaiN := 4
else if (nilaiH = 'B+') or (nilaiH = 'b+') then nilaiN := 3.5
else if (nilaiH = 'B'or (nilaiH = 'b'then nilaiN := 3
else if (nilaiH = 'C+') or (nilaiH = 'c+') then nilaiN := 2.5
else if (nilaiH = 'C'or (nilaiH = 'c'then nilaiN := 2
else if (nilaiH = 'D+') or (nilaiH = 'd+') then nilaiN := 1.5
else if (nilaiH = 'D'or (nilaiH = 'd'then nilaiN := 1
else nilaiN := 0;
end;
procedure tampildata;
begin
for I:= 1 to N do
begin
writeln ('                        Kartu Hasil Studi                        ');
writeln ('                    Jurusan Teknik Informatika                   ');
writeln ('           Fakultas ILMU KOMPUTER UNIKA ST.THOMAS SUMUT          ');
writeln ('                     Semester  20../20..                         ');
writeln('=================================================================');
writeln('Nama Mahasiswa : ',TabMhs[I].nama);
writeln('NPM Mahasiswa : ',TabMhs[I].NIM);
writeln('---------------------------------------------------------------');
writeln(' No    Kode MK    Nama Mata Kuliah    SKS   Nilai   SKS x Nilai');
writeln('---------------------------------------------------------------');
for J := 1 to M do
begin
konversinilai;
TabMhs[I].mk[J].sksxnilai := nilaiN * TabMhs[I].mk[J].sks;
writeln(J:2,TabMhs[I].mk[J].kodemk:13,TabMhs[I].mk[J].namamk:20,TabMhs[I].mk[J].sks:5,TabMhs[I].mk[J].nilai:7,
TabMhs[I].mk[J].sksxnilai:13:1);
TabMhs[I].skstotal := TabMhs[I].skstotal + TabMhs[I].mk[J].sks;
TabMhs[I].nilaitotal := TabMhs[I].nilaitotal + TabMhs[I].mk[J].sksxnilai;
end;
writeln('---------------------------------------------------------------');
writeln('                TOTA L           ',TabMhs[I].skstotal:7,TabMhs[I].nilaitotal:20:1);
writeln('---------------------------------------------------------------');
TabMhs[I].ip := TabMhs[I].nilaitotal / TabMhs[I].skstotal;
writeln('IP Semester = ',TabMhs[I].nilaitotal:0:1,'/',TabMhs[I].skstotal,' = ',TabMhs[I].ip:0:2);
ambilsks;
writeln('SKS yang dapat diambil semester berikutnya = ',TabMhs[I].nextsks);
writeln;
end;
end;
procedure bacadata;
begin
for I := 1 to N do
begin
write('NRP Mahasiswa ke - ',I,' = ');readln(TabMhs[I].NIM);
write('Nama Mahasiswa ke - ',I,' = ');readln(TabMhs[I].nama);
write('Jumlah Mata Kuliah = ');readln(M);
writeln('--------------------------------------------------');
for J := 1 to M do
begin
write('Kode Matakuliah ke - ',J,' = ');readln(TabMhs[I].mk[J].kodemk);
write('Nama Matakuliah = ');readln(TabMhs[I].mk[J].namamk);
write('SKS Matakuliah = ');readln(TabMhs[I].mk[J].sks);
write('nilai Matakuliah = ');readln(TabMhs[I].mk[J].nilai);
writeln('--------------------------------------------------');
end;
end;
end;
begin
write('Masukkan Jumlah Data Mahasiswa = ');readln(N);
Repeat
//clrscr;
bacadata;
//clrscr;
tampildata;
write ('Anda Ingin Memasukkan Data Mahasiswa Lagi? [Y/N] : ');readln(tambah);
tambah := Upcase(tambah);
until (tambah <> 'Y');
//Donewincrt;
end.

Download Tutorial Latihan Visual basic 6.0

Tutorial Latihan Vb 6.0 Download Download

Download Source code Program Virus

Download code Program Hospital

Source code Program Hospital Download

Download code Program Billing Warnet

Source code Program Billing Warnet Download

DOWNLOAD E-BOOK Mahir Visual Basic 6.0

E-BOOK Mahir Visual Basic 6.0 Download

Friday, June 29, 2012

Calculator Program Netbine



In this tutorial we are providing you an example which illustrates you how to a create calculator in Swing with the source code and screen shot.

Writing Calculator Program in Swing

     
In this tutorial we are providing you an example which illustrates you how to a create calculator in Swing with the source code and screen shot.
For developing a small calculator program in swing we need two different classes
1) SwingCalculator.java
2) Calculator.java

The SwingCalculator.java calls the Calculator.java class by JFrame frame = new Calculator(). All the methods and actions are to be performed in Calculator.java class.
Calculator Code in Java Swing


Please save the code as SwingCalculator.java

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;

class SwingCalculator {
 public static void main(String[] args) {
  JFrame frame = new Calculator();
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.setVisible(true);
  }
}

Here is the code of Calculator.java

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;

  class Calculator extends JFrame {
  private final Font BIGGER_FONT = new Font("monspaced",
  Font.PLAIN, 
20);
  private JTextField textfield; 
  private boolean number = true;  
  private String  equalOp  = "=";  
  private CalculatorOp op = new CalculatorOp(); 

  public Calculator() {
  textfield = new JTextField("0"12);
  textfield.setHorizontalAlignment(JTextField.RIGHT);
  textfield.setFont(BIGGER_FONT);
  
  ActionListener numberListener = new NumberListener();
  String buttonOrder = "1234567890 ";
  JPanel buttonPanel = new JPanel();
  buttonPanel.setLayout(new GridLayout(4444));
  for (int i = 0; i < buttonOrder.length(); i++) {
  String key = buttonOrder.substring(i, i+1);
  if (key.equals(" ")) {
  buttonPanel.add(new JLabel(""));
  else {
  JButton button = new JButton(key);
  button.addActionListener(numberListener);
  button.setFont(BIGGER_FONT);
  buttonPanel.add(button);
  }
  }
  ActionListener operatorListener = new OperatorListener();
  JPanel panel = new JPanel();
  panel.setLayout(new GridLayout(4444));
  String[] opOrder = {"+""-""*""/","=","C"};
 for (int i = 0; i < opOrder.length; i++) {
  JButton button = new JButton(opOrder[i]);
  button.addActionListener(operatorListener);
  button.setFont(BIGGER_FONT);
  panel.add(button);
  }
 JPanel pan = new JPanel();
  pan.setLayout(new BorderLayout(44));
  pan.add(textfield, BorderLayout.NORTH );
  pan.add(buttonPanel , BorderLayout.CENTER);
  pan.add(panel , BorderLayout.EAST  );
  this.setContentPane(pan);
  this.pack();
  this.setTitle("Calculator");
  this.setResizable(false);
  }
  private void action() {
  number = true
  textfield.setText("0");
  equalOp  = "=";
  op.setTotal("0");
  }
  class OperatorListener implements ActionListener {
  public void actionPerformed(ActionEvent e) {
  if (number) {
  action();
  textfield.setText("0");
  else {
  number = true
  String displayText = textfield.getText();
  if (equalOp.equals("=")) {
  op.setTotal(displayText);
  else if (equalOp.equals("+")) {
  op.add(displayText);
  else if (equalOp.equals("-")) {
  op.subtract(displayText);
  else if (equalOp.equals("*")) {
  op.multiply(displayText);
  else if (equalOp.equals("/")) {
  op.divide(displayText);
  }
 textfield.setText("" + op.getTotalString());
 equalOp = e.getActionCommand();
  }
 }
 }
  class NumberListener implements ActionListener {
  public void actionPerformed(ActionEvent event) {
  String digit = event.getActionCommand(); 
  if (number) {
  textfield.setText(digit);
  number = false;
  else {
 textfield.setText(textfield.getText() + digit);
  }
  }
  }
  public class CalculatorOp {
  
private int total; 
public CalculatorOp() {
  total = 0;
  }
 public String getTotalString() {
  return ""+total;
  }
 public void setTotal(String n) {
  total = convertToNumber(n);
  }
 public void add(String n) {
  total += convertToNumber(n);
 }
 public void subtract(String n) {
  total -= convertToNumber(n);
  }
 public void multiply(String n) {
  total *= convertToNumber(n);
  }
   public void divide(String n) {
  total /= convertToNumber(n);
  }
 private int convertToNumber(String n) {
  return Integer.parseInt(n);
  }
}
}

The constructor new CalculatorOp() calls the CalculatorOp class. The Swing component JTextField is used to create textbox on which calculation is to be performed. JPanel arranges the numeric buttons in a panel. JButton is used to perform an action. OperatorListener class is called to perform action on operators, i.e, '+,-,*,/,='. The class NumberListener is called for numbers 0 to 9.

Output will be displayed as: