Maksumah Gamal
41518210049
Rekayasa Perangkat Lunak
1. Biodata
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication1;
/**
* @author hp
*/
public class JavaApplication1 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
[Link]("Nama : Maksumah Gamal");
[Link]("NIM : 41518210049");
[Link]("TTL : Jakarta, 23 Maret 2000");
[Link]("Alamat : Komplek Kodam Jaya Jatiwarna");
[Link]("Email : nozawag052@[Link]");
}
2. Operator Aritmatika
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package [Link];
/**
* @author hp
*/
public class OperatorAritmatika {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
// Buat variabel
int a = 12;
int b = 8;
int c = 5;
// Hitung
int hasil1 = a + b - c;
int hasil2 = a * b / c;
int hasil3 = a + b * c;
int hasil4 = a + b / c;
int hasil5 = (a + b) * c;
int hasil6 = (a - b) * c;
// Print
[Link](hasil1);
[Link](hasil2);
[Link](hasil3);
[Link](hasil4);
[Link](hasil5); }
3. Operator Increment
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package [Link];
/**
* @author hp
*/
public class OperatorIncrementAndDecrement {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
// Buat variabel awal
int a = 0;
int b = 0;
int c = 9;
int d = 9;
// Print ke 1
[Link]("Print ke 1");
[Link]("A = " + a++);
[Link]("B = " + ++b);
[Link]("C = " + c--);
[Link]("D = " + --d);
// Print ke 2
[Link]("Print ke 2");
[Link]("A = " + a++);
[Link]("B = " + ++b);
[Link]("C = " + c--);
[Link]("D = " + --d);
// Print ke 3
[Link]("Print ke 3");
[Link]("A = " + a++);
[Link]("B = " + ++b);
[Link]("C = " + c--);
[Link]("D = " + --d);
// Print ke 4
[Link]("Print ke 4");
[Link]("A = " + a++);
[Link]("B = " + ++b);
[Link]("C = " + c--);
[Link]("D = " + --d);
4. Operator Perbandingan
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package [Link];
/**
* @author hp
*/
public class OperatorPerbandingan {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
// Buat variabel
int a = 10;
int b = 8;
int c = 12;
int d = 5;
// Bandingkan
boolean tes1 = a > b;
boolean tes2 = b < c;
boolean tes3 = (a * 2) >= (b + c);
boolean tes4 = (a / d) <= (c - a);
boolean tes5 = (a - d) == d;
boolean tes6 = (a - b) != (b - d);
boolean tes7 = a > 12;
boolean tes8 = b <= 7;
boolean tes9 = c == 10;
boolean tes10 = d != 5;
// Print
[Link]("Tes ke 1 = " + tes1);
[Link]("Tes ke 2 = " + tes2);
[Link]("Tes ke 3 = " + tes3);
[Link]("Tes ke 4 = " + tes4);
[Link]("Tes ke 5 = " + tes5);
[Link]("Tes ke 6 = " + tes6);
[Link]("Tes ke 7 = " + tes7);
[Link]("Tes ke 8 = " + tes8);
[Link]("Tes ke 9 = " + tes9);
[Link]("Tes ke 10 = " + tes10);