-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSwiggyFoodOrder.java
More file actions
68 lines (48 loc) · 1.8 KB
/
Copy pathSwiggyFoodOrder.java
File metadata and controls
68 lines (48 loc) · 1.8 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import java.util.Scanner;
public class SwiggyFoodOrder{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String food;
int quantity;
int total = 0;
System.out.println("===== SWIGGY FOOD MENU =====");
System.out.println("Pizza - ₹150");
System.out.println("Burger - ₹80");
System.out.println("Dosa - ₹60");
System.out.println("Coffee - ₹30");
System.out.print("\nEnter food item: ");
food = sc.nextLine();
System.out.print("Enter quantity: ");
quantity = sc.nextInt();
// Conditional Statements
if(food.equalsIgnoreCase("Pizza")) {
total = 150 * quantity;
System.out.println("\nPizza Available");
System.out.println("Order Confirmed");
}
else if(food.equalsIgnoreCase("Burger")) {
total = 80 * quantity;
System.out.println("\nBurger Available");
System.out.println("Order Confirmed");
}
else if(food.equalsIgnoreCase("Dosa")) {
total = 60 * quantity;
System.out.println("\nDosa Available");
System.out.println("Order Confirmed");
}
else if(food.equalsIgnoreCase("Coffee")) {
total = 30 * quantity;
System.out.println("\nCoffee Available");
System.out.println("Order Confirmed");
}
else {
System.out.println("\nFood Item Not Found");
}
// Final Bill
if(total > 0) {
System.out.println("Quantity : " + quantity);
System.out.println("Total Bill :" +"₹"+total);
System.out.println("Thanks for Ordering.");
}
}
}