/*
* 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 desi2perpustakaan;
import java.util.Scanner;
/**
*
* @author TOSHIBA
*/
public class DESI2PERPUSTAKAAN {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Scanner scanner = new Scanner(System.in);
String nama,nim,status,jenis_buku;
int jumlah,jenis,biaya,total;
System.out.println("***************************************");
System.out.println("| PROGRAM PERPUSTAKAAN DESI |");
System.out.println("***************************************");
System.out.print("Nama : ");
nama = scanner.nextLine();
System.out.print("NIM : ");
nim = scanner.nextLine();
System.out.print("Jumlah Buku : ");
jumlah = scanner.nextInt();
scanner.nextLine();
String[] judul= new String[jumlah];
for(int loop=0;loop<judul.length;loop+=1){
System.out.print("Judul buku ke-"+(loop+1)+" :");
judul[loop] = scanner.nextLine();
}
System.out.print("Jenis : ");
jenis = scanner.nextInt();
System.out.println("------------------------------------");
if(jenis==1){
jenis_buku = "Komputer";
biaya = 5_000;
}else{
jenis_buku = "Non Komputer";
biaya = 3_000;
}
total = jumlah * biaya;
System.out.println();
System.out.println();
System.out.println("-------------------------------------");
System.out.println(" BUKTI PINJAM MAHASISWA ");
System.out.println("-------------------------------------");
System.out.println(" NAMA MAHASISWA :"+nama);
System.out.println(" NIM :"+nim);
for(int i=0;i<judul.length;i+=1){
System.out.println(" JUDUL "+"ke-"+(i+1)+" :"+judul[i]);
}
System.out.println(" JENIS :"+jenis_buku);
System.out.println(" JUMLAH :"+jumlah);
System.out.println(" BIAYA : "+biaya);
System.out.println("-------------------------------------");
System.out.println(" TOTAL : "+total);
System.out.println("-------------------------------------");
}
}
HASIL
* 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 desi2perpustakaan;
import java.util.Scanner;
/**
*
* @author TOSHIBA
*/
public class DESI2PERPUSTAKAAN {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Scanner scanner = new Scanner(System.in);
String nama,nim,status,jenis_buku;
int jumlah,jenis,biaya,total;
System.out.println("***************************************");
System.out.println("| PROGRAM PERPUSTAKAAN DESI |");
System.out.println("***************************************");
System.out.print("Nama : ");
nama = scanner.nextLine();
System.out.print("NIM : ");
nim = scanner.nextLine();
System.out.print("Jumlah Buku : ");
jumlah = scanner.nextInt();
scanner.nextLine();
String[] judul= new String[jumlah];
for(int loop=0;loop<judul.length;loop+=1){
System.out.print("Judul buku ke-"+(loop+1)+" :");
judul[loop] = scanner.nextLine();
}
System.out.print("Jenis : ");
jenis = scanner.nextInt();
System.out.println("------------------------------------");
if(jenis==1){
jenis_buku = "Komputer";
biaya = 5_000;
}else{
jenis_buku = "Non Komputer";
biaya = 3_000;
}
total = jumlah * biaya;
System.out.println();
System.out.println();
System.out.println("-------------------------------------");
System.out.println(" BUKTI PINJAM MAHASISWA ");
System.out.println("-------------------------------------");
System.out.println(" NAMA MAHASISWA :"+nama);
System.out.println(" NIM :"+nim);
for(int i=0;i<judul.length;i+=1){
System.out.println(" JUDUL "+"ke-"+(i+1)+" :"+judul[i]);
}
System.out.println(" JENIS :"+jenis_buku);
System.out.println(" JUMLAH :"+jumlah);
System.out.println(" BIAYA : "+biaya);
System.out.println("-------------------------------------");
System.out.println(" TOTAL : "+total);
System.out.println("-------------------------------------");
}
}
HASIL
Komentar
Posting Komentar