fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. System.out.println("Кофе-машина");
  10.  
  11. int moneyAmount = 10;
  12.  
  13. int cappucinoPrice = 140;
  14. int lattePrice = 120;
  15. int appleJuicePrice = 40;
  16. int milkPrice = 35;
  17.  
  18. boolean canBuyAnything = false;
  19.  
  20. if(moneyAmount >= cappucinoPrice) {
  21. System.out.println("Вы можете купить капучино");
  22. canBuyAnything = true;
  23. }
  24.  
  25. if(moneyAmount >= lattePrice) {
  26. System.out.println("Вы можете купить латте");
  27. canBuyAnything = true;
  28. }
  29.  
  30. if(moneyAmount >= appleJuicePrice) {
  31. System.out.println("Вы можете купить апельсиновый сок");
  32. canBuyAnything = true;
  33. }
  34. if(moneyAmount >= milk) {
  35. System.out.println("Вы можете купить Молоко");
  36. canBuyAnything = true;
  37. }
  38. if(canBuyAnything == false) {
  39. System.out.println("Недостаточно средств! Учите джаву и идите работать!");
  40. }
  41. }
  42. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:34: error: cannot find symbol
		if(moneyAmount >= milk) {
		                  ^
  symbol:   variable milk
  location: class Ideone
1 error
stdout
Standard output is empty