Your coffee machine should have the same initial resources as in the example (400 ml of water, 540 ml of milk, 120 g of coffee beans, 9 disposable cups, $550 in cash).
import java.util.Scanner;
public class CoffeeMachine {
static int water = 400;
static int milk = 540;
static int beans = 120;
static int cups = 9;
static int money = 550;
public static void main(String[] args) {
action();
}
public static void printScreen() {
System.out.println("The coffee machine has:");
System.out.println(water + " of water");
System.out.println(milk + " of milk");
System.out.println(beans + " of coffee beans");
System.out.println(cups + " of disposable cups");
System.out.println("$" + money + " of money");
System.out.println();
}
public static void action() {
boolean value = true;
do {
System.out.println("Write action (buy, fill, take, remaining, exit):");
String ac = new Scanner(System.in)