-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpenjualanGamis.java
More file actions
49 lines (37 loc) · 1.83 KB
/
penjualanGamis.java
File metadata and controls
49 lines (37 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import java.util.Scanner;
import java.text.DecimalFormat;
public class penjualanGamis{
public static void main(String [] args) {
Scanner s = new Scanner(System.in);
double [] harga = new double[10];
String [] kodeBarang = new String[10];
String nama;
int pesanan = 0;
double total = 0, untung = 0, pendapatanBersih = 0;
System.out.println("---------------------------------------------");
System.out.println(" == Data Pemesanan Gamis/Sarimbit ==");
System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
System.out.print("Masukkan nama penjaga : ");
nama = s.nextLine();
System.out.print("Masukkan banyaknya Pesanan : ");
pesanan = s.nextInt();
for(int i = 0; i < pesanan; i++) {
System.out.print("Pesanan ke " + (i+1) + " : Rp. ");
harga[i] = s.nextDouble();
System.out.print("Kode Barang : ");
kodeBarang[i] = s.next();
}
System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
for(int j = 0; j < pesanan; j++){
total += harga[j];
}
untung = 0.1*(total);
pendapatanBersih = total - untung;
System.out.println(" Hasil Total Pendapatan : Rp. " + total);
System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
System.out.println(" Keuntungan " + pesanan + " Barang : Rp. " + untung);
System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
System.out.println(" Pendapatan Bersih : Rp. " + pendapatanBersih);
System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
}
}