-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCoffeeMachine.java
More file actions
153 lines (145 loc) · 5.45 KB
/
CoffeeMachine.java
File metadata and controls
153 lines (145 loc) · 5.45 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
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
//package machine;
//
//import java.util.Scanner;
//
//public class CoffeeMachine {
// public static void main(String[] args) {
// Scanner scanner = new Scanner(System.in);
//
// int count = 0;
//
// while (true) {
//
// System.out.println("Write Action (buy, fill, take, remaining, exit)");
// String action = scanner.nextLine();
//
// count += 1;
//
// if (action.equals("buy")) {
// if (count > 1) {
// System.out.println("What do you want to buy? 1 - espresso, 2 - latte, 3 - cappuccino, back-to main menu");
// } else {
// System.out.println("What do you want to buy? 1 - espresso, 2 - latte, 3 - cappuccino:");
// }
// String orderOption = scanner.nextLine();
// Buy(orderOption);
// } else if (action.equals("fill")) {
// System.out.println("Write how many ml of water you want to add:");
// int waterRequired = scanner.nextInt();
// System.out.println("Write how many ml of milk you want to add:");
// int milkRequired = scanner.nextInt();
// System.out.println("Write how many g of coffee beans you want to add:");
// int coffeeRequired = scanner.nextInt();
// System.out.println("Write how many disposable cups you want to add:");
// int cupsRequired = scanner.nextInt();
// fill(waterRequired, milkRequired, coffeeRequired, cupsRequired);
// } else if (action.equals("remaining")) {
// remaining();
// } else if (action.equals("exit")) {
// break;
// } else if (action.equals("take")) {
// take();
// } else if (action.equals("Back")) {
// continue;
// } else {
// continue;
// }
// }
//
// }
//
// static int intialAmountOfWater = 400;
// static int intialAmountofMilk = 540;
// static int intialAmountofCoffeBeans = 120;
// static int intialAmountOfCups = 9;
// static int intialAmountOfMoney = 550;
//
// public static void Buy(String CoffeeType) {
// if (CoffeeType.equals("1")) {
// checkEspresso();
// } else if (CoffeeType.equals("2")) {
// checkLatte();
// } else if (CoffeeType.equals("3")) {
// checkCappunicino();
// } else {
// System.out.println("Invalid input. Enter a number");
// }
// }
//
// public static void fill(int water, int milk, int coffee, int cups) {
// intialAmountOfWater += water;
// intialAmountofMilk += milk;
// intialAmountofCoffeBeans += coffee;
// intialAmountOfCups += cups;
// intialAmountOfMoney += 0;
// }
//
// public static void take() {
// System.out.println("I gave you " + (intialAmountOfMoney));
// intialAmountOfMoney -= intialAmountOfMoney;
// }
//
// public static void remaining() {
// System.out.println("This coffee machine has:");
// System.out.println((intialAmountOfWater) + " ml of water");
// System.out.println((intialAmountofMilk) + " ml of milk");
// System.out.println((intialAmountofCoffeBeans) + " g of coffee beans");
// System.out.println((intialAmountOfCups) + " disposable cups");
// System.out.println("$" + (intialAmountOfMoney) + " of money");
// }
//
// public static void checkEspresso() {
// if (intialAmountOfWater < 250) {
// System.out.println("Sorry, not enough water!");
// } else if (intialAmountofCoffeBeans < 16) {
// System.out.println("Sorry, not enough coffee!");
// } else {
// System.out.println("I have enough resources, making you a coffee");
// intialAmountOfWater -= 250;
// intialAmountofCoffeBeans -= 16;
// intialAmountOfCups -= 1;
// intialAmountOfMoney += 4;
// }
// }
//
// public static void checkLatte() {
// if (intialAmountOfWater < 350) {
// System.out.println("Sorry, not enough water!");
// } else if (intialAmountofMilk < 75) {
// System.out.println("Sorry, not enough milk!");
// } else if (intialAmountofCoffeBeans < 20) {
// System.out.println("Sorry, not enough coffee!");
// } else {
// System.out.println("I have enough resources, making you a coffee");
// intialAmountOfWater -= 350;
// intialAmountofMilk -= 75;
// intialAmountofCoffeBeans -= 20;
// intialAmountOfCups -= 1;
// intialAmountOfMoney += 7;
// }
// }
//
// public static void checkCappunicino() {
// if (intialAmountOfWater < 350) {
// System.out.println("Sorry, not enough water!");
// } else if (intialAmountofMilk < 75) {
// System.out.println("Sorry, not enough milk!");
// } else if (intialAmountofCoffeBeans < 20) {
// System.out.println("Sorry, not enough coffee!");
// } else {
// System.out.println("I have enough resources, making you a coffee");
// intialAmountOfWater -= 200;
// intialAmountofMilk -= 100;
// intialAmountofCoffeBeans -= 12;
// intialAmountOfCups -= 1;
// intialAmountOfMoney += 6;
// }
// }
//
//
//}
//
package machine;
import java.util.Scanner;
public class CoffeeMachine {
}