import java.io.* ;
public class ujijava{
public static void main(String Arg[]) throws IOException{
double harga= 0, total = 0 ;
int jml=0 ;
String str ;
BufferedReader Get=new BufferedReader(new InputStreamReader(System.in)) ;
System.out.println("Menghitung Harga Photo Copy") ;
System.out.print("Jumlah Lembar : ") ; str = Get.readLine() ;
jml = Integer.parseInt(str) ;
if(jml>500) harga = 90 ;
else if(jml>200) harga = 125 ;
else harga = 150 ;
total = harga * jml ;
System.out.println("Harga per Lembar : "+ harga) ;
System.out.println("Total Harga : "+ total) ;
}
}
Hasilnya:
Tidak ada komentar:
Posting Komentar