Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions src/main/java/com/geekbrains/HomeWorkApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,42 @@ public class HomeWorkApp {
public static void main(String[] args) {

}

public static boolean isSumBetween10And20(int a, int b) {
int sum = a+b;
if (sum>10 && sum<=20) {
return true;
}
return false;
}

public static void isPositiveOrNegativePrint(int a) {
if (a>=0)
System.out.println("Число положтельное");
else
System.out.println("Число отрицательное");
}

public static boolean isPositiveOrNegativeReturn(int a) {
if (a>=0)
return false;
else
return true;
}

public static void printStringSeveralTimes(String str, int count) {
for (int i = 0; i < count; i++) {
System.out.println(str);
}

}

public static boolean isLeapYear (int year) {
if ((year%4==0 && year%100!=0) || (year%400==0)) {
return true;
}
else
return false;
}

}