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; | |
/** | |
* Created by Connor on 10/5/15. | |
*/ | |
public class RomanNumbers { | |
public int input; | |
//parametrized constructor |
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
/** | |
* Created by Connor on 10/19/15. | |
*/ | |
public class Primes { | |
//class method called isPrime(int p) which determines if an integer p is a prime number. Assume p > 1. | |
public static boolean isPrime(int p) { | |
if (p <= 1) return false; | |
if (p == 2) 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
/** | |
* Created by Connor on 10/19/15. | |
*/ | |
public class Primes { | |
/** class method called isPrime(int p) which determines if an integer p is a prime number. Assume p > 1. */ | |
public static boolean isPrime(int p) { | |
if (p <= 1) return false; | |
if (p == 2) return true; | |
//check if n is a multiple of 2 |
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
/** | |
* Created by Connor on 10/30/15. | |
*/ | |
public class Ch6Hw8 { | |
public static void printV(int height) { | |
int width = (height * 2) - 1; | |
int farV = width; | |
for (int i = 1; i <= height; i++, farV--) { | |
for (int j = 1; j <= width; j++) { |
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
/** | |
* Created by Connor on 11/4/15. | |
*/ | |
public class MyArt { | |
private Picture image; | |
/** | |
* Create an Art object using the jpg or bmp at the indicated location | |
*/ | |
public MyArt(String filename) |
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.*; | |
/** | |
* Created by Connor on 11/19/15. | |
*/ | |
public class Histogram { | |
private int [] values; | |
private int interval; | |
public Histogram(){ | |
values = new int[100]; |
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; | |
import java.util.Scanner; | |
public class MyPlaces | |
{ | |
/** | |
* Instance variable: a collection which is | |
* always in alphabetic order | |
*/ | |
private ArrayList<String> places; |
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
/** | |
* Created by Connor on 12/8/15. | |
*/ | |
public class Rack { | |
private Vial[][] rack; | |
public Rack(){ | |
rack = new Vial[3][8]; //instantiates the rack when object is created | |
} |
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
/** | |
* Created by Connor on 1/21/16. | |
*/ | |
public interface Information { | |
public int getLength(); | |
public String getName(); | |
} |
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
/** | |
* Created by Connor on 1/21/16. | |
*/ | |
public interface Information { | |
public int getLength(); | |
public String getName(); | |
} | |
//TODO: this less than other == -1 this greater than other == 1 else 0 |
OlderNewer