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
$crypto = @" | |
P k T r 2 s z 2 * c F - | |
r a z 7 G u D 4 w 6 U # | |
g c t K 3 E @ B t 1 a Y | |
Q P i c % 7 0 5 Z v A e | |
W 6 j e P R f p m I ) H | |
y ^ L o o w C n b J d O | |
S i 9 M b e r # ) i e U | |
* f 2 Z 6 M S h 7 V u D | |
5 a ( h s v 8 e l 1 o W |
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 TeenNumberChecker { | |
public static boolean hasTeen(int a,int b,int c){ | |
if (a >=13 && a <=19 || | |
b >=13 && b <=19 || | |
c >=13 && c <=19 ) { | |
return true; | |
} | |
return false; |
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 AreaCalculator { | |
public static double area (double radius) { | |
if (radius<0) { | |
return -1.0d; | |
} | |
double areaOfCircle = ((Math.PI * (radius*radius))); | |
return areaOfCircle; |
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 NumberPalindrome { | |
public static boolean isPalindrome(int number){ | |
if (number < 0){ | |
number = number - (number*2); | |
} | |
String reverseNumber = ""; | |
int newNumber = number; |
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 static int sumFirstAndLastDigit(int number){ | |
if (number < 0 ) { | |
return -1; | |
} | |
int firstDigit = number%10; | |
int lastDigit=0; | |
for (int i = number; i != 0; i /= 10){ | |
lastDigit = i%10; |
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 static int getEvenDigitSum(int number){ | |
if (number < 0){ | |
return -1; | |
} | |
int sum=0; | |
for (int i = number; i !=0; i /= 10){ | |
if ((i%10)%2==0){ | |
sum+=i%10; |
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 static int getGreatestCommonDivisor(int first, int second){ | |
if ((first<10)||(second<10)){ | |
return -1; | |
} | |
int gtDivisor=1; | |
for (int i=2;i<=((first+second)/2);i++) | |
if ((first%i==0)&&(second%i==0)){ | |
gtDivisor=i; | |
} | |
return gtDivisor; |
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 static int getBucketCount(double width, double height, double areaPerBucket, int extraBuckets) { | |
if ((width <= 0) || (height <= 0) || (areaPerBucket <= 0)||(extraBuckets<0)) { | |
return -1; | |
} | |
double wallArea = (width * height); | |
int bucketsNeeded = (int) ((wallArea / areaPerBucket) - extraBuckets); | |
if (bucketsNeeded < (wallArea/areaPerBucket)){ |
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 SimpleCalculator { | |
private double firstNumber; | |
private double secondNumber; | |
public double getFirstNumber(){ | |
return firstNumber; | |
} | |
public double getSecondNumber(){ | |
return secondNumber; |
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 Wall { | |
// Params | |
private double width; | |
private double height; | |
// Constructors | |
public Wall() { | |
} | |
public Wall(double width,double height){ |
OlderNewer