Posts

Contoh LA ( Laporan Akhir ) Praktikum Bahasa Pemrograman Java 3

Image
LISTING PROGRAM Tugas I import java.io.*; public class rata { public static void main(String[] args) { BufferedReader dataIn = new BufferedReader(new InputStreamReader (System.in)); String a = ""; String b = ""; String c = "";         System.out.print("Nilai ujian pertama = ");         try{         a = dataIn.readLine();         }catch(IOException e){System.out.print ("error"); }                               System.out.print("Nilai Ujian kedua = ");         try{         b = dataIn.readLine();         }catch(IOException e){System.out.print ("error"); }           ...

Contoh LA ( Laporan Akhir ) Praktikum Bahasa Pemrograman Java 2

Image
LISTING PROGRAM Tugas I import java.io.*; public class Fibonaci{ public static void main(String[] args) throws IOException{ BufferedReader masuk= new BufferedReader(new InputStreamReader(System.in));            String jumlahfibo = null; int a=0, b=1, c=0, i=1;            System.out.print("Masukkan jumlah deret fibonaci: "); jumlahfibo = masuk.readLine();            int jumlah; jumlah = Integer.parseInt(jumlahfibo);                       System.out.println(b); do{ c = a + b; System.out.println(c); a = b; b = c;            i++; }while (i < jumlah); } } Tugas II import java.io.*; public class SegitigaSiku{ public static void main(String args[]) throws IOException{ BufferedReader masukan = new...