diff --git a/src/homework/HomeWorkApp.java b/src/homework/HomeWorkApp.java new file mode 100644 index 0000000..0e83237 --- /dev/null +++ b/src/homework/HomeWorkApp.java @@ -0,0 +1,49 @@ +package homework; + +public class HomeWorkApp { + + public static void main(String[] args) { + printThreeWords(); + checkSumSign(); + printColor(); + compareNumbers(); + } + + public static void printThreeWords(){ + System.out.println("Orange"); + System.out.println("Banana"); + System.out.println("Apple"); + } + + public static void checkSumSign(){ + int a = 30; + int b = 50; + int c = a + b; + if (c >=0) { + System.out.println("Сумма положительная"); + } else { + System.out.println("Сумма отрицательная"); + } + } + + public static void printColor(){ + int value = 150; + if (value <=0){ + System.out.println("Красный"); + } else if(value >0 && value <=100){ + System.out.println("Желтый"); + } else if(value >100){ + System.out.println("Зеленый"); + } + } + public static void compareNumbers(){ + int a = 20; + int b = 10; + if (a>=b){ + System.out.println("a>=b"); + } else { + System.out.println("a