Cari yg kamu Butuhkan Di Sini
Mengenai Saya
Arsip Blog
-
▼
2014
(30)
-
▼
September
(12)
- Program " Baca Array "
- Program " Rata-rata Bilangan "
- Program " Panjang, Lebar & Luas "
- Program " Hello "
- Selamat Datang Di Entri IT
- Selamat Datang Di Entri Sejarah
- Selamat Datang Di Entri Psikologi
- Selamat Datang Di Entri Inspiratif
- Selamat Datang Di Entri Belajar Gambar
- Selamat Datang Di Entri Tokoh
- Selamat Datang Di Entri Blogger
- Selamat Datang Di Entri Lain-lain
-
▼
September
(12)
Total Tayangan Halaman
import javax.swing.*;
class BacaArray
{
public static void main(String[] args)
{ int max = -9999, min = 99999, tot = 0, i;
int[] A = new int[6];
System.out.println("Masukkan ke-6 elemen array A ... ");
for (i=0;i<=5;i++)
{
String sbil = JOptionPane.showInputDialog(null,"Bilangan ke-"+(i+1));
A[i] = Integer.parseInt(sbil);
if (A[i] > max) max = A[i];
if (A[i] < min) min = A[i];
tot += A[i];
}
System.out.print("\nA = [");
for (i=0;i<=5;i++)
{ System.out.print(" "+A[i]);
}
System.out.println(" ]\n\nElemen terbesar = " +max);
System.out.println("Elemen terkecil = " +min);
System.out.println("Total elemen = "+tot);
System.out.println("Rata-rata elemen = "+((float)(tot)/6));
}
}
class BacaArray
{
public static void main(String[] args)
{ int max = -9999, min = 99999, tot = 0, i;
int[] A = new int[6];
System.out.println("Masukkan ke-6 elemen array A ... ");
for (i=0;i<=5;i++)
{
String sbil = JOptionPane.showInputDialog(null,"Bilangan ke-"+(i+1));
A[i] = Integer.parseInt(sbil);
if (A[i] > max) max = A[i];
if (A[i] < min) min = A[i];
tot += A[i];
}
System.out.print("\nA = [");
for (i=0;i<=5;i++)
{ System.out.print(" "+A[i]);
}
System.out.println(" ]\n\nElemen terbesar = " +max);
System.out.println("Elemen terkecil = " +min);
System.out.println("Total elemen = "+tot);
System.out.println("Rata-rata elemen = "+((float)(tot)/6));
}
}
import java.util.*;
class RataRata
{
public static void main(String[] args)
{ Scanner bacaan = new Scanner(System.in);
int a,b,c,d,e;
float rata;
System.out.print("Masukkan 5 bil = ");
a = bacaan.nextInt();
b = bacaan.nextInt();
c = bacaan.nextInt();
d = bacaan.nextInt();
e = bacaan.nextInt();
rata = (float)(a+b+c+d+e)/5;
System.out.println("Rata-rata bilangan = " + rata);
}
}
class RataRata
{
public static void main(String[] args)
{ Scanner bacaan = new Scanner(System.in);
int a,b,c,d,e;
float rata;
System.out.print("Masukkan 5 bil = ");
a = bacaan.nextInt();
b = bacaan.nextInt();
c = bacaan.nextInt();
d = bacaan.nextInt();
e = bacaan.nextInt();
rata = (float)(a+b+c+d+e)/5;
System.out.println("Rata-rata bilangan = " + rata);
}
}
import java.util.Scanner;
class Program3
{
public static void main(String[] args)
{ Scanner baca = new Scanner(System.in);
int a,b;
System.out.print("Panjang = ");
a = baca.nextInt();
System.out.print("Lebar = ");
b = baca.nextInt();
System.out.println("Luas = " + (a*b));
}
}
class Program3
{
public static void main(String[] args)
{ Scanner baca = new Scanner(System.in);
int a,b;
System.out.print("Panjang = ");
a = baca.nextInt();
System.out.print("Lebar = ");
b = baca.nextInt();
System.out.println("Luas = " + (a*b));
}
}
public class Hello
{
// public Hello() { }
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
{
// public Hello() { }
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
Penyiksaan Hewan Tersadis Jaman Sekarang ( Sangking Sadis nya, Dimohon Jangan Dibuka )
Misteri Lukisan Leornardo Da Vinci "The Last supper"
Ciri-ciri wanita sudah tidak perawan
Sindrom “Angin Duduk”
Dampak Negatif Perokok Aktif dan Pasif
Perhitungan nilai kalori makanan
Gambar Jakarta tempo dulu
Pengertian sajak
Langganan:
Postingan
(Atom)
Diberdayakan oleh Blogger.