This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MegaBytesConverter { | |
public static void printMegaBytesAndKiloBytes(int kiloBytes){ | |
if (kiloBytes < 0){ | |
System.out.println("Invalid Value"); | |
} else { | |
int megabytes = (kiloBytes/1024); | |
int kiloRemainder = kiloBytes%1024; | |
System.out.println(kiloBytes+" KB = "+megabytes+" MB and "+kiloRemainder+" KB"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BarkingDog { | |
public static boolean shouldWakeUp(boolean barking,int hourOfDay){ | |
if (hourOfDay <0 || hourOfDay >23){ | |
return false; | |
} | |
if (barking == true && hourOfDay <8 || hourOfDay >22){ | |
return true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EqualSumChecker { | |
public static boolean hasEqualSum (int a, int b, int c) { | |
if (a+b==c){return true;} | |
return false; | |
} | |
} |