/*
* TheTree.java
*
* Created on October 22, 2008, 2:10 AM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package aa04_2008420037;
/**
*
* @author mhs
*/
public class TheTree {
/** Creates a new instance of TheTree */
public TheTree() {
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
System.out.println(“I thi nk t hat I shal l never see “);
System.out.println(“a poem as l ovel y as a t r ee “);
System.out.println(“A tree whose hungry mouth i s pressed”);
System.out.println(“Agai nst t he Earth’s sweet fl owi ng breast”);
System.out.println(” * ** ** * ** ** “);
System.out.println(” * * * * * * * * * * * “);
System.out.println(” * * ** * * * * ** * “);
System.out.println(” * * * * ***** * * * “);
System.out.println(” * * * * * * * “);
// TODO code application logic here
}
}
/*
* latihanInput.java
*
* Created on October 31, 2008, 8:51 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package latihaninput;
import java.util.Scanner;
/**
*
* @author root
*/
public class latihanInput {
/** Creates a new instance of latihanInput */
public latihanInput() {
}
public static void main(String[]args){
Scanner input= new Scanner(System.in);
double alas;
double tinggi;
double luas, kel, miring;
System.out.println(“Masukan Angka”);
alas = input.nextDouble();
System.out.println(“Masukan Angka”);
tinggi = input.nextDouble();
luas = alas * tinggi/2;
double kuadrat = (Math.pow(alas,2))+(Math.pow(tinggi,2));
miring = Math.sqrt(kuadrat);
kel = alas + tinggi +miring;
System.out.println(“Luas =” +luas);
System.out.println(“Keliling =” +kel);
}
}
TUGAS 3
/*
* tugas2pertemuan2.java
*
* Created on October 23, 2008, 3:46 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package pertemuan2;
/**
*
* @author root
*/
public class tugas2pertemuan2 {
/** Creates a new instance of tugas2pertemuan2 */
public tugas2pertemuan2() {
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
short IntMin = Short.MIN_VALUE;
short IntMax = Short.MAX_VALUE;
System.out.println(“nilai Short antara “+ IntMin + “dan” +IntMax);
long LongMin = Long.MIN_VALUE;
long LongMax = Long.MAX_VALUE;
System.out.println(“nilai Long antara “+ LongMin + “dan” +LongMax);
float FloatMin = Float.MIN_VALUE;
float FloatMax = Float.MAX_VALUE;
System.out.println(“nilai Float antara “+ FloatMin + “dan” + FloatMax);
double DoubleMin = Double.MIN_VALUE;
double DoubleMax = Double.MIN_VALUE;
System.out.println(“nilai Double antara “+ DoubleMin + “dan” + DoubleMax);
String nama = “Nova Tampati”;
String alamat = “Surabaya”;
String nim = “2008420088″;
String hobi = “Dengarkan music”;
System.out.println(“Nama :”+ nama);
System.out.println(“Alamat :”+ alamat);
System.out.println(“Nim :”+ nim);
System.out.println(“Hobi :”+ hobi);
System.out.println(“<<<<<(Hasil Dari Perhitungan Segitiga Yang Saya Lakukan Menhasilkan)>>>>>”);
int alas = 15;
int tinggi = 13;
int luas = (alas * tinggi)/2;
int miring = (alas^2 + tinggi^2);
int keliling = (alas + tinggi + miring);
System.out.println(“luas :”+luas);
System.out.println(“miring :”+miring);
System.out.print(“keliling :”+keliling);
// TODO code application logic here
}
}
Tinggalkan sebuah Komentar
Belum ada komentar.
Komentar RSS Lacak Balik URI Pengenal
