Untitled

mail@pastecode.io avatar
unknown
java
2 years ago
1.6 kB
3
Indexable
Never
if(choice==3)
			{
				System.out.println("=====================================");
				System.out.println("	Wemen Marketing Agent	");
				System.out.println("=====================================");
				if(arr.isEmpty())
				{
					System.out.println("Empty!");
				}
				else
				{
					for(int i = 0;i<arr.size();i++)
					{
						System.out.println("No		: "+(i+1));
						System.out.println("Media		: "+arr.get(i).getMediaPromosi().getClass().getSimpleName());
						System.out.println("Nama		: "+arr.get(i).getMediaPromosi().getNama());
						System.out.println("Tanggal		: "+arr.get(i).getTanggal());
						System.out.println("Durasi Kontrak	: "+arr.get(i).getJangkaWaktu());
						System.out.println("Harga		: "+arr.get(i).getMediaPromosi().getHarga());
						System.out.println("=====================================");
					}
					System.out.println("1. Batalkan Order");
					System.out.println("2. Kembali ke menu utama");
					System.out.println("=====================================");
					while(true)
					{
						System.out.print("Pilih menu(1-2): ");
						choice2 = s.nextInt();
						if(choice2 == 1 || choice2 == 2)
						{
							break;
						}
					}
					if(choice2==1)
					{
						System.out.print("Masukkan nomor yang ingin dibatalkan: ");
						int nomor = s.nextInt();
						if(arr.get(nomor-1).getTanggal().equals("24112022"))
						{
							System.out.println("Pesanan ini tidak bisa dibatalkan!");
						}
						else
						{
							arr.remove(nomor-1);
							System.out.println("Pesanan berhasil dibatalkan");
						}
					}
				}
			}