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
import java.util.Scanner; | |
public class PlayerRoster { | |
public static void main(String[] args) { | |
Scanner scan = new Scanner(System.in); | |
int[][] players = new int[5][2]; | |
boolean keepAlive = true; | |
char input; | |
for (int i = 0; i < 5; i++) { |
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 Tabby extends Cat { | |
public String meow() { | |
return "meow meow"; | |
} | |
} | |
public class Siamese extends Cat { | |
public String meow() { | |
return "if you please"; | |
} |
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
import java.util.List; | |
import java.util.ArrayList; | |
public class MasterSubscription { | |
private List<MagazineOrder> orders; | |
public MasterSubscription() { | |
orders = new ArrayList<MagazineOrder>(); | |
} |
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 FlipFlop { | |
public static String findFlipFlop(int testNm) { | |
String retString = ""; | |
for (int i = 1; i <= testNm; i++) { | |
boolean three = i % 3 == 0; | |
boolean five = i % 5 == 0; | |
if (three || five) { | |
if (three) { | |
retString += "Flip"; | |
} |
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
import java.util.ArrayList; | |
public class BaseballPlayer { | |
public ArrayList<Integer> playerStats; | |
public BaseballPlayer(int numHits, int numRuns, int numRBIs) { | |
playerStats = new ArrayList<Integer>(); | |
playerStats.add(numHits); | |
playerStats.add(numRuns); | |
playerStats.add(numRBIs); |
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 ArrayChecker { | |
private int[][] testNums; | |
public ArrayChecker(int[][] testNums) { | |
this.testNums = testNums; | |
} | |
public int arrayInstance(int instance) { | |
int instances = 0; | |
for (int[] testNum : testNums) { |
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 ArrayMadness { | |
public static int findMax(int [] numbersArray) { | |
int max = numbersArray[0]; | |
for (int number : numbersArray) { | |
if (number > max) { | |
max = number; | |
} | |
} | |
return max; | |
} |
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 StringOps { | |
private String[] words; | |
public StringOps(String[] wordStrings){ | |
words = wordStrings; | |
} | |
public String stringHalf(boolean firstHalf) { | |
String finalString = ""; | |
for (String word : words) { |