-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcoba.java
More file actions
30 lines (26 loc) · 1.17 KB
/
coba.java
File metadata and controls
30 lines (26 loc) · 1.17 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
import java.util.Scanner;
public class coba {
@SuppressWarnings("resource")
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Input Nama Restoran : ");
String RestoranA = input.nextLine();
System.out.println("Input waktu kunjungan : ");
String Waktu = input.nextLine();
System.out.println("Input Menu Pertama : ");
String Menu1 = input.nextLine();
System.out.println("Beli Berapa : ");
int Menu1Jumlah = input.nextInt();
System.out.println("Berapa RB : ");
int Menu1Harga = input.nextInt();
input.nextLine();
System.out.println("Input Menu Kedua : ");
String Menu2 = input.nextLine();
System.out.println("Beli Berapa : ");
int Menu2Jumlah = input.nextInt();
System.out.println("Berapa RB : ");
int Menu2Harga = input.nextInt();
int Total = (Menu1Jumlah * Menu1Harga) + (Menu2Jumlah * Menu2Harga);
System.out.println("Albert needs " + Total + "Rupiah for buying" + Menu1Jumlah + " " + Menu1 + " and " + Menu2Jumlah + " " + Menu2 + " in " + RestoranA + " at " + Waktu);
}
}