/******************************************************************************
Online Java Compiler.
Code, Compile, Run and Debug java program online.
Write your code in this editor and press "Run" button to execute it.
*******************************************************************************/
public class Main
{
public static void main(String[] args)
{
System.out.println("Кофе-машина");
int moneyAmount = 12;
int cappucinoPrice = 150;
int espressoPrice = 80;
int waterPrice = 20;
int milkPrict = 50;
boolean canBuyAnything = false;
if(moneyAmount >= cappucinoPrice) {
System.out.println("Вы можете купить капучино");
canBuyAnything = true;
}
if(moneyAmount >= espressoPrice) {
System.out.println("Вы можете купить эспрессо");
canBuyAnything = true;
}
if(moneyAmount >= milkPrice) {
System.out.println("Вы можете купить молоко");
canBuyAnything = true;
}
if(moneyAmount >= waterPrice) {
System.out.println("Вы можете купить воду");
canBuyAnything = true;
}
if(canBuyAnything == false) {
System.out.println("Недостаточно средств :( Изучите Java, и средств всегда будет хватать :)");
}
}
}