/*========================================================================
programmer: hendra silaban
nama file : input data
tanggal : 25 nov 2011
deskripsi : -menginput data
-penggunaan swith case didalam switch ========================================================================*/
import javax.swing.JOptionPane;
class DreamTeam
{
public static void main(String[] args)
{
String namaclubS;
int namaclub;
String realmadridS;
int realmadrid;
String man_cityS;
int man_city;
String liverpoolS;
int liverpool;
String man_unitedS;
int man_united;
Selasa, 29 November 2011
Program Mencari Nilai Terbesar Dengan cara Menginput Data
/*========================================================================
programmer: Hendra Silaban
nama file : input data
tanggal : 29 nov 2011
deskripsi : -menginput data
-mencari nilai terbesar
========================================================================*/
import javax.swing.JOptionPane;
class ContohIf
{
public static void main(String[] args)
{
String nilaiAs;
int nilaiA;
String nilaiBs;
int nilaiB;
String nilaiCs;
int nilaiC;
nilaiAs = JOptionPane.showInputDialog("nilai A = " );
nilaiA = Integer.parseInt(nilaiAs);
programmer: Hendra Silaban
nama file : input data
tanggal : 29 nov 2011
deskripsi : -menginput data
-mencari nilai terbesar
========================================================================*/
import javax.swing.JOptionPane;
class ContohIf
{
public static void main(String[] args)
{
String nilaiAs;
int nilaiA;
String nilaiBs;
int nilaiB;
String nilaiCs;
int nilaiC;
nilaiAs = JOptionPane.showInputDialog("nilai A = " );
nilaiA = Integer.parseInt(nilaiAs);
Senin, 28 November 2011
Penggunaan Switch Case Didalam Switch Case
Pada program berikut,diterapkan bagaimana penggunaan switch case didalam switch case.Dimisalkan penggunaan Switch case pada menu makanan.... !!!
/*========================================================================
programmer: Hendra Silaban
nama file : input data
tanggal : 14 nov 2011
deskripsi : -menginput data
-penggunaan swith case didalam switch
========================================================================*/
import javax.swing.JOptionPane;
class SwitchDidalamSwitch
{
public static void main(String[] args)
{
String menumakanans;
int menumakanan;
String nasis;
int nasi;
String minumans;
int minuman;
String ikans;
/*========================================================================
programmer: Hendra Silaban
nama file : input data
tanggal : 14 nov 2011
deskripsi : -menginput data
-penggunaan swith case didalam switch
========================================================================*/
import javax.swing.JOptionPane;
class SwitchDidalamSwitch
{
public static void main(String[] args)
{
String menumakanans;
int menumakanan;
String nasis;
int nasi;
String minumans;
int minuman;
String ikans;
Program Penggunaan Switch Case
/*========================================================================
programmer: Hendra Silaban
nama file : input data
tanggal : 28 nov 2011
deskripsi : -menginput data
-penggunaan switch case
========================================================================*/
import javax.swing.JOptionPane;
class SwitchCase
{
public static void main(String[] args)
{
String nilai1s;
int nilai1;
nilai1s = JOptionPane.showInputDialog("masukan pilihan : ");
nilai1 = Integer.parseInt(nilai1s);
switch (nilai1)
{
case 1:JOptionPane.showMessageDialog(null,"satu");
break;
case 2:JOptionPane.showMessageDialog(null,"dua");
break;
case 3:JOptionPane.showMessageDialog(null,"tiga");
break;
default:JOptionPane.showMessageDialog(null,"tidak ada");
programmer: Hendra Silaban
nama file : input data
tanggal : 28 nov 2011
deskripsi : -menginput data
-penggunaan switch case
========================================================================*/
import javax.swing.JOptionPane;
class SwitchCase
{
public static void main(String[] args)
{
String nilai1s;
int nilai1;
nilai1s = JOptionPane.showInputDialog("masukan pilihan : ");
nilai1 = Integer.parseInt(nilai1s);
switch (nilai1)
{
case 1:JOptionPane.showMessageDialog(null,"satu");
break;
case 2:JOptionPane.showMessageDialog(null,"dua");
break;
case 3:JOptionPane.showMessageDialog(null,"tiga");
break;
default:JOptionPane.showMessageDialog(null,"tidak ada");
Program Penjumlahan bilangan Dengan Cara Menginput Data
/*========================================================================
nama file : input data
tanggal : 28 nov 2011
programmer : hendra silaban
deskripsi : -menginput data
========================================================================*/
import javax.swing.JOptionPane;
class Penjumlahan
{
public static void main(String[] args)
{
String A1S;
int A1;
String A2S;
int A2;
String A3S;
int A3;
String A4S;
nama file : input data
tanggal : 28 nov 2011
programmer : hendra silaban
deskripsi : -menginput data
========================================================================*/
import javax.swing.JOptionPane;
class Penjumlahan
{
public static void main(String[] args)
{
String A1S;
int A1;
String A2S;
int A2;
String A3S;
int A3;
String A4S;
Jumat, 25 November 2011
Program Mencari Nilai Tahanan Dengan Cara Menginput Data
/*========================================================================
nama file : input data
tanggal : 14 nov 2011
programmer: hendra silaban
deskripsi : -menginput data
========================================================================*/
import javax.swing.JOptionPane;
class Tahanan
{
public static void main(String[] args)
{
String R1S;
double R1;
String R2S;
double R2;
String R3S;
double R3;
double seri;
double pararel;
R1S = JOptionPane.showInputDialog("masukkan nilai resistor a = ");
R1 = Integer.parseInt(R1S);
R2S = JOptionPane.showInputDialog("masukkan nilai resistor b = ");
R2 = Integer.parseInt(R2S);
R3S = JOptionPane.showInputDialog("masukkan nilai resistor c = ");
R3 = Integer.parseInt(R3S);
seri = R1 + R2 + R3;
pararel = 1/(double)R1 + 1/(double)R2 + 1/(double)R3;
JOptionPane.showMessageDialog(null , "Tahanan total seri : " + seri +
"\nTahanan total pararel : " + pararel);
}
}
nama file : input data
tanggal : 14 nov 2011
programmer: hendra silaban
deskripsi : -menginput data
========================================================================*/
import javax.swing.JOptionPane;
class Tahanan
{
public static void main(String[] args)
{
String R1S;
double R1;
String R2S;
double R2;
String R3S;
double R3;
double seri;
double pararel;
R1S = JOptionPane.showInputDialog("masukkan nilai resistor a = ");
R1 = Integer.parseInt(R1S);
R2S = JOptionPane.showInputDialog("masukkan nilai resistor b = ");
R2 = Integer.parseInt(R2S);
R3S = JOptionPane.showInputDialog("masukkan nilai resistor c = ");
R3 = Integer.parseInt(R3S);
seri = R1 + R2 + R3;
pararel = 1/(double)R1 + 1/(double)R2 + 1/(double)R3;
JOptionPane.showMessageDialog(null , "Tahanan total seri : " + seri +
"\nTahanan total pararel : " + pararel);
}
}
Rabu, 23 November 2011
Program Penggajian Karyawan
/*========================================================================
nama file : input data
tanggal : 28 nov 2011
programmer : hendra silaban
deskripsi : -menginput data
-penggajian karyawan sesuai jabatan
========================================================================*/
import javax.swing.JOptionPane;
class GajiPegawai
{
public static void main(String[] args)
{
String NamaKaryawan;
String NamaStaff;
String NamaBendahara;
String JamKerjaS;
int JamKerja;
int Karyawan;
int Staff;
nama file : input data
tanggal : 28 nov 2011
programmer : hendra silaban
deskripsi : -menginput data
-penggajian karyawan sesuai jabatan
========================================================================*/
import javax.swing.JOptionPane;
class GajiPegawai
{
public static void main(String[] args)
{
String NamaKaryawan;
String NamaStaff;
String NamaBendahara;
String JamKerjaS;
int JamKerja;
int Karyawan;
int Staff;
Selasa, 22 November 2011
Program Mengkonversi Suhu Celcius ke Fahrenheit, Rheamur & Kelvin
/*========================================================================
nama file : Input Data
tanggal : 22 nov 2011
programmer : Hendra Silaban
deskripsi : - Menginput Data
- Program Mengkonversi Suhu Celcius ke Fahrenheit,
Rheamur & Kelvin
========================================================================*/
import javax.swing.JOptionPane;
class Temperatur
{
public static void main(String[] args)
{
String CelciusS;
int Celcius;
double Fahrenheit;
double Rheamur;
double Kelvin;
CelciusS = JOptionPane.showInputDialog("masukkan suhu cuaca = ");
Celcius = Integer.parseInt(CelciusS);
nama file : Input Data
tanggal : 22 nov 2011
programmer : Hendra Silaban
deskripsi : - Menginput Data
- Program Mengkonversi Suhu Celcius ke Fahrenheit,
Rheamur & Kelvin
========================================================================*/
import javax.swing.JOptionPane;
class Temperatur
{
public static void main(String[] args)
{
String CelciusS;
int Celcius;
double Fahrenheit;
double Rheamur;
double Kelvin;
CelciusS = JOptionPane.showInputDialog("masukkan suhu cuaca = ");
Celcius = Integer.parseInt(CelciusS);
Program Mengkonversi Rupiah Ke Mata Uang Asing
/*========================================================================
import javax.swing.JOptionPane;
class Ekivalensi
{
public static void main(String[] args)
{
String RupiahS;
int Rupiah;
double Dollar;
double Yen;
double DM;
double FF;
nama file : Input Data
tanggal : 22 nov 2011
programmer : Hendra Silaban
deskripsi : - Menginput Data
- Mengkonversi Rupiah Ke Mata Uang Asing
========================================================================*/import javax.swing.JOptionPane;
class Ekivalensi
{
public static void main(String[] args)
{
String RupiahS;
int Rupiah;
double Dollar;
double Yen;
double DM;
double FF;
Senin, 21 November 2011
Program Mengkonversi Rupiah Ke Dollar
/*
nama file : input data
tanggal : 14 nov 2011
programmer: hendra silaban
deskripsi : -menginput data
*/
import javax.swing.JOptionPane;
nama file : input data
tanggal : 14 nov 2011
programmer: hendra silaban
deskripsi : -menginput data
*/
import javax.swing.JOptionPane;
Program Mencari Nilai Tegangan (volt)
/*
nama file : input data
tanggal : 14 nov 2011
programmer: hendra silaban
deskripsi : -menginput data
*/
import javax.swing.JOptionPane;
nama file : input data
tanggal : 14 nov 2011
programmer: hendra silaban
deskripsi : -menginput data
*/
import javax.swing.JOptionPane;
Selasa, 15 November 2011
Kalkulator Sederhana JAVA
/* nama file : input data tanggal : 14 nov 2011 programmer: hendra silaban deskripsi : -menginput data */ import javax.swing.JOptionPane;
Senin, 14 November 2011
Kalkulator Paling Sederhana
/* nama file : input data tanggal : 14 nov 2011 programmer: hendra silaban deskripsi : -menginput data */ import javax.swing.JOptionPane;
Langganan:
Postingan (Atom)