0% found this document useful (0 votes)
12 views1 page

Bahan

The document contains code to calculate areas of shapes and output biodata. It defines variables, performs calculations for the area of a circle and square, and outputs a student's biodata.

Uploaded by

Donny Setiawan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

Bahan

The document contains code to calculate areas of shapes and output biodata. It defines variables, performs calculations for the area of a circle and square, and outputs a student's biodata.

Uploaded by

Donny Setiawan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

int a, b, c;

boolean hasil;
a = 5;
b = 7;

a += 3; System.out.println (a);
a *= 2; System.out.println (b);
hasil = (a + a) < (b + a); System.out.println(hasil);
hasil = b == a; System.out.println(hasil);
b += 5; System.out.println(b);
hasil = a == (b+15); System.out.println(hasil);
a -= 1; System.out.println(a);
a += b; System.out.println(a);
hasil = b != 15; System.out.println(b);
c = a%b; System.out.println(c);

System.out.println(a);
System.out.println(b);

hasil = a < 12; System.out.println(hasil);


a -= b-1; System.out.println(hasil);

//Menampilkan Output Biodata Mahasiswa


System.out.println("====================================================");
System.out.println(" Biodata Mahasiswa ");
System.out.println("====================================================");
System.out.println("Nama Lengkap : " + "Donny Setiawan");
System.out.println("NIM : " + "312020026");
System.out.println("Kelas : " + "TK20C");
System.out.println("Prodi : " + "D3 - Teknik Komputer");
System.out.println("Angkatan : " + "2020");
System.out.println("TTL : " + "Sukabumi, 03-September-2020");
System.out.println("Alamat : " + "Jl. Raya Rambay No 25");
System.out.println("No Telp : " + "089516823902");
System.out.println("Email : " + "[email protected]");
System.out.println("====================================================");

System.out.println("Menghitung Luas Lingkaran");

double phi = 3.14;


int r = 9; //Jari jari = 9
double hasil = phi * (r * r);//Rumus Luas Lingkaran

System.out.println("Luas Lingkaran : "+hasil);

System.out.println("Menghitung Luas Persegi");


int sisi, luas;
sisi = 8; // Di ketahui semua sisinya 8 cm
luas = sisi * sisi; //Rumus Luas Persegi
System.out.println("Luas Persegi : "+luas);

You might also like