This file contains hidden or 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.*; | |
| public class Magic8Ball | |
| { | |
| public static void main (String[] args) { | |
| String[] messages = {"Answer Unclear Ask Again Later", "Don't Bet on It", "The Stars Say No", "You Can Count on It", "So It Shall Be", "Focus And Ask Again", "Chances Aren't Good","Prospect Good"}; | |
| Scanner s = new Scanner(System.in); | |
| String input = ""; | |
| while (!input.equals("X")) { | |
| System.out.print("Ask a Question (Enter X to Exit): "); | |
| input = s.nextLine(); |
This file contains hidden or 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.*; | |
| public class TravelingSalesPerson | |
| { | |
| boolean[] visited = new boolean[7]; | |
| String distance = ""; | |
| int totDistance = 0; | |
| public TravelingSalesPerson() { | |
| String[] cities = {"Boston", "L.A.", "Las Vegas", "Atlanta", "Philadelphia", "Chicago", "Houston"}; |
This file contains hidden or 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.*; | |
| public class PasswordGenerator { | |
| public static void main(String arg[]){ | |
| String[] al = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9"}; | |
| ArrayList<String> pass = new ArrayList<String>(); | |
| String password = ""; | |
| while (!containsCapital(password) || !containsLowerCase(password) || !containsNumber(password)) { | |
| password = ""; |
This file contains hidden or 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
| QBR Class | |
| import java.util.*; | |
| public class CalculatePasserRating{ | |
| public static void main (String[] args) { | |
| double a = 0.0; | |
| double b = 0.0; | |
| double c = 0.0; | |
| double d = 0.0; | |
| int passerRating = 0; |
This file contains hidden or 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
| Starter Class | |
| import javax.swing.JFrame; | |
| public class ConnectStarter extends JFrame { | |
| public ConnectStarter() { | |
| add(new ConnectBoard()); | |
| setTitle("ConnectBoard"); | |
| setDefaultCloseOperation(EXIT_ON_CLOSE); | |
| setSize(348,500); |
This file contains hidden or 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
| /** | |
| * Interface of Ursidae family (bears) | |
| * | |
| * @Laura | |
| * @1.0 | |
| */ | |
| public interface Ursidae | |
| { | |
| public void color(); | |
| public void diet(); |
This file contains hidden or 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.*; | |
| import java.io.*; | |
| public class PokerHandsv2 | |
| { | |
| ArrayList<String> tempHands = new ArrayList<String>(); | |
| String fileName = "poker.txt"; | |
| String line = null; | |
| int[] cards = {2,3,4,5,6,7,8,9,10,11,12,13,14}; | |
| String[] cards2 = {"2","3","4","5","6","7","8","9","T","J","Q","K","A"}; | |
| int player1Score = 0; |
This file contains hidden or 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.*; | |
| public class PyramidOfNumbers | |
| { | |
| public static void main (String[] args) { | |
| int rows = 6; | |
| int[] row1 = {2}; | |
| int[] row2 = {2,2}; | |
| int[] prev = row2; | |
| int temp2 = 0; |
This file contains hidden or 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.*; | |
| public class PennyGame | |
| { | |
| //0 is heads and 1 is tails | |
| ArrayList<Integer> player1 = new ArrayList<Integer>(); | |
| ArrayList<Integer> player2 = new ArrayList<Integer>(); | |
| ArrayList<Integer> coinFlips = new ArrayList<Integer>(); | |
| int player1Score = 0; | |
| int player2Score = 0; |
This file contains hidden or 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
| /** | |
| * Generates a magic square of dimensions entered. | |
| * | |
| * @Laura | |
| * @1.0 | |
| */ | |
| import java.util.*; | |
| public class MagicSquare |