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 boolean in3050(int a, int b) { | |
return ((a >= 30 && a <= 40) && (b >= 30 && b <= 40) | |
|| (a >= 40 && a <= 50) && (b >= 40 && b <= 50)); | |
} |
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 int close10(int a, int b) { | |
if(Math.abs(a - 10) == Math.abs(b - 10)) { | |
return 0; | |
} | |
else { | |
if(Math.abs(a - 10) < Math.abs(b - 10)) { | |
return a; | |
} | |
else { | |
return b; |
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 int intMax(int a, int b, int c) { | |
if(a > b && a > c) { | |
return a; | |
} | |
else if(b > c) { | |
return b; | |
} | |
else { | |
return c; | |
} |
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 String startOz(String str) { | |
String tempStr = ""; | |
if(str.length() >= 1 && str.charAt(0) == 'o') { | |
tempStr += 'o'; | |
} | |
if(str.length() >= 2 && str.charAt(1) == 'z') { | |
tempStr += 'z'; | |
} | |
return tempStr; | |
} |
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 boolean mixStart(String str) { | |
return(str.length() >= 3 && str.substring(1,3).equals("ix")); | |
} |
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 String delDel(String str) { | |
if(str.length() >= 4 && str.substring(1,4).equals("del")) { | |
return str.substring(0,1) + str.substring(4); | |
} | |
else { | |
return str; | |
} | |
} |
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 boolean loneTeen(int a, int b) { | |
return (a >= 13 && a <= 19) ^ (b >= 13 && b <= 19); | |
} |
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 boolean hasTeen(int a, int b, int c) { | |
return (a >= 13 && a <= 19) || (b >= 13 && b <= 19) || (c >= 13 && c <= 19); | |
} |
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 boolean in1020(int a, int b) { | |
return (a >= 10 && a <= 20) || (b >= 10 && b <= 20); | |
} |
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 boolean startHi(String str) { | |
return (str.length() >= 2 && str.substring(0,2).equals("hi")); | |
} |