Category: Java

0

Java kuliah latihan input nilai mahasiswa

import java.util.Scanner; import java.util.Formatter; public class latihan_input_nilai_formatter{ public static void main(String[] arg){ Scanner inputan = new Scanner(System.in); int jum_mhs = 2; String vars[] = {“NPM”,”Nama”,”N. UTS”,”N. UAS”,”N. Praktikum”,”Nilai Akhir”}; String a[][] = new String[jum_mhs][vars.length];...

0

Java switch case

import java.util.Scanner; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; public class switch_case { public static void main(String[] argumen){ while(true){ int indeks = 0; String ul=””; BufferedReader dataInput = new BufferedReader(new InputStreamReader(System.in)); try{ Scanner s =...

0

Java cek umur

import java.util.Scanner; public class cek_umur { public static void main(String[] argumen){ int umur = 0; Scanner s = new Scanner(System.in); System.out.print(“masukkan umur : “); umur = s.nextInt(); if(umur<0){ System.out.print(“belum lahir”); } else if(umur>=0 &&...

0

Java tugas perpustakaan

¬†import java.util.Scanner; public class tugas_perpustakaan { public static void main(String[] argumen){ System.out.println(“=============================================================”); System.out.println(“=============================================================”); System.out.println(“”); System.out.println(“Data Peminjam :”); System.out.println(“1. Pelajar”); System.out.println(“2. Mahasiswa”); System.out.println(“3. Umum”); System.out.println(“”); System.out.println(“=============================================================”); System.out.println(“=============================================================”); int status,min_buku=1,min_hari=1,max_buku=15,jml_buku=0,max_hari=7,hari,harga_pelajar=500, harga_mahasiswa=1000,harga_umum=1500 ; double diskon_l10=5,diskon_l5=2.5,diskon=0,total_diskon=0, harga_buku=0, total_harga_perhari,total_harga_perbuku,total_harga;...