-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpbo-3.java
executable file
·173 lines (123 loc) · 7.55 KB
/
pbo-3.java
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
import java.util.Scanner;
public class Sekolah {
private int pengembanganPrice = 3000000;
private int sppPrice = 1200000;
private int kegiatanPrice = 3500000;
private int raportPrice = 500000;
private int totalPrice = 0;
public static void screen() {
// clear screen console
System.out.print('\u000C');
System.out.println("=============================================");
System.out.println(" RA.Al-Karomah Bogor");
System.out.println("=============================================");
System.out.println("");
System.out.println("Silahkan pilih bayaran yang ingin dibayar !!!");
System.out.println("1). Pengembangan");
System.out.println("2). Spp");
System.out.println("3). Kegiatan");
System.out.println("4). Raport");
System.out.println("---------------------------------------------");
}
public void result(int pengembanganChoice, int sppChoice, int kegiatanChoice, int raportChoice) {
if (pengembanganChoice == 1 && sppChoice == 1 && kegiatanChoice == 1 && raportChoice == 1) {
System.out.println("Terima Kasih Telah Melunasi Semua");
} else if (pengembanganChoice == 1 && sppChoice == 1 && kegiatanChoice == 2 && raportChoice == 1) {
this.totalPrice = this.pengembanganPrice + this.sppPrice + this.raportPrice;
System.out.println("uang kegiatan belum Rp." + this.kegiatanPrice);
System.out.println("Total Yang Sudah Dibayarkan Rp." + this.totalPrice);
} else if (pengembanganChoice == 1 && sppChoice == 1 && kegiatanChoice == 1 && raportChoice == 2) {
this.totalPrice = this.pengembanganPrice + this.sppPrice + this.kegiatanPrice;
System.out.println("uang raport belum Rp." + this.raportPrice);
System.out.println("Total Yang Sudah Dibayarkan Rp." + this.totalPrice);
} else if (pengembanganChoice == 1 && sppChoice == 1 && kegiatanChoice == 2 && raportChoice == 2) {
this.totalPrice = this.pengembanganPrice + this.sppPrice;
System.out.println("uang kegiatan belum Rp." + this.kegiatanPrice);
System.out.println("uang raport belum Rp." + this.raportPrice);
System.out.println("Total Yang Sudah Dibayarkan Rp." + this.totalPrice);
} else if (pengembanganChoice == 2 && sppChoice == 1 && kegiatanChoice == 1 && raportChoice == 1) {
this.totalPrice = this.sppPrice + this.kegiatanPrice + this.raportPrice;
System.out.println("uang pengembangan belum Rp." + this.pengembanganPrice);
System.out.println("Total Yang Sudah Dibayarkan Rp." + this.totalPrice);
} else if (pengembanganChoice == 2 && sppChoice == 1 && kegiatanChoice == 2 && raportChoice == 1) {
this.totalPrice = this.sppPrice + this.raportPrice;
System.out.println("uang pengembangan belum Rp." + this.pengembanganPrice);
System.out.println("uang kegiatan belum Rp." + this.kegiatanPrice);
System.out.println("Total Yang Sudah Dibayarkan Rp." + this.totalPrice);
} else if (pengembanganChoice == 2 && sppChoice == 1 && kegiatanChoice == 1 && raportChoice == 2) {
this.totalPrice = this.sppPrice + this.kegiatanPrice;
System.out.println("uang pengembangan belum Rp." + this.pengembanganPrice);
System.out.println("uang raport belum Rp." + this.raportPrice);
System.out.println("Total Yang Sudah Dibayarkan Rp." + this.totalPrice);
} else if (pengembanganChoice == 2 && sppChoice == 1 && kegiatanChoice == 2 && raportChoice == 2) {
this.totalPrice = this.sppPrice;
System.out.println("uang pengembangan belum Rp." + this.pengembanganPrice);
System.out.println("uang kegiatan belum Rp." + this.raportPrice);
System.out.println("uang raport belum Rp." + this.raportPrice);
System.out.println("Total Yang Sudah Dibayarkan Rp." + this.totalPrice);
} else if (pengembanganChoice == 1 && sppChoice == 2 && kegiatanChoice == 1 && raportChoice == 1) {
this.totalPrice = this.pengembanganPrice + this.kegiatanPrice + this.raportPrice;
System.out.println("uang spp belum Rp." + this.sppPrice);
System.out.println("Total Yang Sudah Dibayarkan Rp." + this.totalPrice);
} else if (pengembanganChoice == 1 && sppChoice == 2 && kegiatanChoice == 2 && raportChoice == 1) {
this.totalPrice = this.pengembanganPrice + this.raportPrice;
System.out.println("uang spp belum Rp." + this.sppPrice);
System.out.println("uang kegiatan belum Rp." + this.kegiatanPrice);
System.out.println("Total Yang Sudah Dibayarkan Rp." + this.totalPrice);
} else if (pengembanganChoice == 1 && sppChoice == 2 && kegiatanChoice == 1 && raportChoice == 2) {
this.totalPrice = this.pengembanganPrice + this.kegiatanPrice;
System.out.println("uang spp belum Rp." + this.sppPrice);
System.out.println("uang raport belum Rp." + this.raportPrice);
System.out.println("Total Yang Sudah Dibayarkan Rp." + this.totalPrice);
} else if (pengembanganChoice == 2 && sppChoice == 2 && kegiatanChoice == 1 && raportChoice == 2) {
this.totalPrice = this.kegiatanPrice;
System.out.println("uang pengembangan belum Rp." + this.pengembanganPrice);
System.out.println("uang spp belum Rp." + this.sppPrice);
System.out.println("uang raport belum Rp." + this.raportPrice);
System.out.println("Total Yang Sudah Dibayarkan Rp." + this.totalPrice);
} else if (pengembanganChoice == 2 && sppChoice == 2 && kegiatanChoice == 1 && raportChoice == 1) {
this.totalPrice = this.kegiatanPrice + this.raportPrice;
System.out.println("uang pengembangan belum Rp." + this.pengembanganPrice);
System.out.println("uang spp belum Rp." + this.sppPrice);
System.out.println("Total Yang Sudah Dibayarkan Rp." + this.totalPrice);
} else if (pengembanganChoice == 2 && sppChoice == 2 && kegiatanChoice == 2 && raportChoice == 1) {
this.totalPrice = this.raportPrice;
System.out.println("uang pengembangan belum Rp." + this.pengembanganPrice);
System.out.println("uang spp belum Rp." + this.sppPrice);
System.out.println("uang kegiatan belum Rp." + this.kegiatanPrice);
System.out.println("Total Yang Sudah Dibayarkan Rp." + this.totalPrice);
} else if (pengembanganChoice == 2 && sppChoice == 2 && kegiatanChoice == 2 && raportChoice == 2) {
System.out.println("HARAP LUNASI SEGERA !!!!");
} else {
System.out.println("PEMBAYARAN TIDAK TERSEDIA !!!!");
}
}
public static void main(String[] args) {
// Initialize Layer
Sekolah.screen();
// Initialize Scanner
Scanner input = new Scanner(System.in);
// Get Pengembangan
System.out.println("[Pembayaran] pilih 1 jika ya, pilih 2 jika tidak: ");
int choicePengembangan = input.nextInt();
// Get Spp
System.out.println("[Spp] pilih 1 jika ya, pilih 2 jika tidak: ");
int choiceSpp = input.nextInt();
// Get Kegiatan
System.out.println("[Kegiatan] 1 jika ya, pilih 2 jika tidak: ");
int choiceKegiatan = input.nextInt();
// Get Raport
System.out.println("[Raport] 1 jika ya, pilih 2 jika tidak: ");
int choiceRaport = input.nextInt();
System.out.println("------------------------------------------");
// Initialize Constructor
Sekolah data = new Sekolah();
// Print Result
System.out.println("=============================================");
System.out.println(" Report Pembayaran Sekolah Anda:");
System.out.println("=============================================");
data.result(choicePengembangan, choiceSpp, choiceKegiatan, choiceRaport);
System.out.println("=============================================");
System.out.println("=============================================");
}
}