Last active
January 28, 2018 12:05
-
-
Save nelvson/b69c53db92ca2392dd83de4f3d23a0cc to your computer and use it in GitHub Desktop.
Solusi Week 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Week1 { | |
public static void main(String[] args) { | |
Scanner reader = new Scanner(System.in); | |
System.out.printf("Masukkan tanggal lahir, bulan lahir, dan tahun lahir\n"); | |
System.out.printf("Setiap variabel dipisah dengan spasi\nInput : "); | |
short tanggalLahir = reader.nextByte(); | |
byte bulanLahir = reader.nextByte(); | |
byte tahunLahir = reader.nextByte(); | |
System.out.printf("Output tanggal lahir : %d\n", tanggalLahir); | |
System.out.printf("Output bulan lahir : %d\n",bulanLahir); | |
System.out.printf("Output tahun lahir : %d\n",tahunLahir); | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Week1 { | |
public static void main(String[] args) { | |
Scanner reader = new Scanner(System.in); | |
System.out.printf("Masukkan jumlah karyawan : "); | |
short jumlahKaryawan = reader.nextShort(); | |
System.out.printf("Jumlah karyawan perusahaan Stark : %d\n", jumlahKaryawan); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Week1 { | |
public static void main(String[] args) { | |
Scanner reader = new Scanner(System.in); | |
System.out.printf("Masukkan radius dari lingkaran\n"); | |
short radius = reader.nextByte(); | |
final double pi = 3.14; | |
System.out.printf("Input radius : %d\n", radius); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment