Script Membuat Aplikasi Kedai Elektronik di Neatbents
Script Membuat Aplikasi Kedai Elektronik di Neatbents
package kedaielektronik;
import java .io.*;
public class KedaiElektronik {
public static void main(String[] args)throws Exception{
String nama, nama_barang,kondisi, Kode_barang, member;
int totalharga;
int jumlah;
int harga=0;
double total;
total = 0;
double dis, diskon;
BufferedReader Get=new BufferedReader(new InputStreamReader(System.in));
System.out.print("Nama :"); nama = Get.readLine();
System.out.print("Kode Barang :"); Kode_barang = Get.readLine();
System.out.print("Nama Barang :"); nama_barang = Get.readLine();
System.out.print("Kondisi :"); kondisi = Get.readLine();
System.out.print("Anda Membernya :"); member = Get.readLine();
if(Kode_barang.equals("1001")){
if(nama_barang.equals("Sumsang")){
if(kondisi.equals("Baru")){
harga=3000000;
}else if(kondisi.equals("Bekas")){
harga=1900000;
}
}
}else if(Kode_barang.equals("1002")){
if(nama_barang.equals("SHARP")){
}else if(kondisi.equals("Baru")){
harga=2800000;
}else if(kondisi.equals("Bekas")){
harga=1500000;
}
}else if(Kode_barang.equals("1003")){
if(nama_barang.equals("LG")){
}else if(kondisi.equals("Baru")){
harga=3300000;
}else if(kondisi.equals("Bekas")){
harga=1700000;
}
}else if(Kode_barang.equals("1004")){
if(nama_barang.equals("Sumsang")){
}else if(kondisi.equals("Baru")){
harga=1800000;
}else if(kondisi.equals("Bekas")){
harga=1000000;
}
}
System.out.println("Harga :"+harga);
System.out.println("Kondisi :"+kondisi);
System.out.println("Merek :"+Kode_barang);
System.out.print("Jumlah Beli :"); jumlah = Integer.parseInt(Get.readLine());
if(jumlah <= 3 & jumlah <= 7){
dis=0.035;
totalharga=harga*jumlah;
diskon = totalharga*dis;
total=(int) (totalharga-diskon);
System.out.println("Total Harga :"+totalharga);
System.out.println("Diskon :"+diskon);
System.out.println("Total :"+total);
}else if(jumlah <= 7 & jumlah <=25){
dis=0.10;
totalharga=harga*jumlah;
diskon=totalharga*dis;
total=(int) (totalharga-diskon);
System.out.println("Total Harga :"+totalharga);
System.out.println("Diskon :"+diskon);
System.out.println("Total :"+total);
}else{
total=harga*jumlah;
System.out.println("Total"+total);
}
}
}
import java .io.*;
public class KedaiElektronik {
public static void main(String[] args)throws Exception{
String nama, nama_barang,kondisi, Kode_barang, member;
int totalharga;
int jumlah;
int harga=0;
double total;
total = 0;
double dis, diskon;
BufferedReader Get=new BufferedReader(new InputStreamReader(System.in));
System.out.print("Nama :"); nama = Get.readLine();
System.out.print("Kode Barang :"); Kode_barang = Get.readLine();
System.out.print("Nama Barang :"); nama_barang = Get.readLine();
System.out.print("Kondisi :"); kondisi = Get.readLine();
System.out.print("Anda Membernya :"); member = Get.readLine();
if(Kode_barang.equals("1001")){
if(nama_barang.equals("Sumsang")){
if(kondisi.equals("Baru")){
harga=3000000;
}else if(kondisi.equals("Bekas")){
harga=1900000;
}
}
}else if(Kode_barang.equals("1002")){
if(nama_barang.equals("SHARP")){
}else if(kondisi.equals("Baru")){
harga=2800000;
}else if(kondisi.equals("Bekas")){
harga=1500000;
}
}else if(Kode_barang.equals("1003")){
if(nama_barang.equals("LG")){
}else if(kondisi.equals("Baru")){
harga=3300000;
}else if(kondisi.equals("Bekas")){
harga=1700000;
}
}else if(Kode_barang.equals("1004")){
if(nama_barang.equals("Sumsang")){
}else if(kondisi.equals("Baru")){
harga=1800000;
}else if(kondisi.equals("Bekas")){
harga=1000000;
}
}
System.out.println("Harga :"+harga);
System.out.println("Kondisi :"+kondisi);
System.out.println("Merek :"+Kode_barang);
System.out.print("Jumlah Beli :"); jumlah = Integer.parseInt(Get.readLine());
if(jumlah <= 3 & jumlah <= 7){
dis=0.035;
totalharga=harga*jumlah;
diskon = totalharga*dis;
total=(int) (totalharga-diskon);
System.out.println("Total Harga :"+totalharga);
System.out.println("Diskon :"+diskon);
System.out.println("Total :"+total);
}else if(jumlah <= 7 & jumlah <=25){
dis=0.10;
totalharga=harga*jumlah;
diskon=totalharga*dis;
total=(int) (totalharga-diskon);
System.out.println("Total Harga :"+totalharga);
System.out.println("Diskon :"+diskon);
System.out.println("Total :"+total);
}else{
total=harga*jumlah;
System.out.println("Total"+total);
}
}
}
0 Response to "Script Membuat Aplikasi Kedai Elektronik di Neatbents"
Post a Comment
Silahkan Komentar ....