<file_sep>package paintWizard;

public class Paint {

	private String name;
	private int size;
	private double cost;
	private double area;

	public Paint(String name, int size, double cost, double area) {
		this.name = name;
		this.size = size;
		this.cost = cost;
		this.area = area;
	}

	public void toString(String name, int size, double cost, double area) {

		System.out.println(name + " " + size + " " + cost + " " + area);
	}
}
<file_sep>package library;

import static org.junit.Assert.*;

import org.junit.Test;

public class libraryTest {

	Storage S =new Storage();
	
//	@Test
//	public void addItemTest() {
//		int size =Storage.Items.size();
//		Storage.addBook("test", true, 100, "Fantasy","J.k.lowing");
//		assertEquals(Storage.Items.size(),size+1);
//		Storage.removeItem("test");
//		
//	}
//	
//	@Test
//	public void removeItemTest() {
//		
//		Storage.addBook("test", true, 100, "Fantasy","J.k.lowing");
//		int size =Storage.Items.size();
//		Storage.removeItem("test");
//		assertEquals(Storage.Items.size(),size-1);
//		
//	}
	
	@Test
	public void updateItemTest() {
		
		S.addBook("test", true, 150, "Fantasy","J.k.lowing");
		
		S.updateItemName(150,"test2");
		
		System.out.println(S.Items.get(S.Items.size()-1).name);
		
		assertEquals("test2",S.Items.get(S.Items.size()-1).name);

		
	}

}<file_sep>package battleship;

public class Main {

	public static void main(String[] args) {
		
		Board b = new Board();
		
		b.createBoard();
		
		Ship.placeShip(ShipType.BATTLESHIP, b);
		
		
		Ship s = new Ship("j", 4, 4, 4, 4);
		
		s.place("igh",b);
		
		

	}

}
<file_sep>package battleship;

import java.util.Scanner;

public class Board {

	int playerBoard[][];
	int computerBoard[][];
	public void createBoard() {
		System.out.println("What size width would you like the board to be? It should be between 2 and 15");
		Scanner w = new Scanner(System.in);
		int width = w.nextInt();

		System.out.println("What size height would you like the board to be? it should be bewtween 2 and 15");
		Scanner h = new Scanner(System.in);
		int height = h.nextInt();

		playerBoard = new int[width][height];
		computerBoard = new int[width][height];

		if (width < 16 && width > 1 && height < 16 && height > 1) {
			System.out.println("You have a board size of " + width + " by " + height + "\nYour board has "
					+ width * height + " spaces");

		} else {
			System.out.println("Your values are out not between 2 and 15");
			createBoard();
			w.close();
			h.close();
		}

	}
	public int[][] getPlayerBoard() {
		return playerBoard;
	}
	public void setPlayerBoard(int[][] playerBoard) {
		this.playerBoard = playerBoard;
	}
	public int[][] getComputerBoard() {
		return computerBoard;
	}
	public void setComputerBoard(int[][] computerBoard) {
		this.computerBoard = computerBoard;
	}



}
<file_sep>public class Person {
	private String name;
	private int age;
	private String Job;

	public Person(String name, int age, String Job) {

		this.name = name;
		this.age = age;
		this.Job = Job;
		//System.out.println("Person name is " + name + " age is " + age + " Job is " + Job);
	}

	
	public String getName() {
		return name;
	}

	public String toString() {
		return ("Person name : " + name + " age : " + age + " Job : " + Job);
	}

}
<file_sep>package factorials;

public class Factorial {

	public static void main(String[] args) {
		float f = 1;

		System.out.println(fact1(f));
	}

	public static String fact1(float f) {

		int i = 1;
		float result = 0;
		do {
			if (i >= f) {
				break;
			}
			i++;
			result = f / i;
			if (result == 1) {
				return (i + "!");

			} else {
				f = result;

			}

		} while (f > i);

		return "Not a factorial";
	}
}
<file_sep>package library;

public class Magazine extends Item{

	private String name;
	private boolean isAvailable;
	private int id;
	private String publisher;



	public Magazine(String name, boolean isAvailable, int id, String publisher) {
		super(name, isAvailable, id);
		this.publisher = publisher;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public boolean isAvailable() {
		return isAvailable;
	}

	public void setAvailable(boolean isAvailable) {
		this.isAvailable = isAvailable;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getPublisher() {
		return publisher;
	}

	public void setPublisher(String publisher) {
		this.publisher = publisher;
	}

}
<file_sep>#Mon Jul 02 15:18:11 BST 2018
org.eclipse.core.runtime=2
org.eclipse.platform=4.7.0.v20170612-0950
<file_sep>package battleship;

public enum ShipType {
	PATROLBOAT, BATTLESHIP, SUBMARINE, DESTROYER, CARRIER
}
<file_sep>package Vehicle;

public class Vehicle {

	
	public int speed;
	public int cost;


	public int getSpeed() {
		return speed;
	}

	public int getCost() {
		return cost;
	}

}

class Car extends Vehicle {
	public int noOfSeats;

	public Car(int maxSpeed, int price, int seats) {

		
		this.speed = maxSpeed;
		this.cost = price;
		this.noOfSeats = seats;

	}

	public int getNoOfSeats() {
		return noOfSeats;
	}

	public String toString() {

		return (speed + " " + cost + " " + noOfSeats);

	}
}

class Boat extends Vehicle {

	public int propelers;

	public Boat(int maxSpeed, int price, int propeler) {

		this.speed = maxSpeed;
		this.cost = price;
		this.propelers = propeler;

	}

	public int getPropelers() {
		return propelers;
	}

	public String toString() {

		return (speed + " " + cost + " " + propelers);

	}
}

class Bus extends Vehicle {
	int number;
	public int psng;

	public Bus(int maxSpeed, int price, int busNo, int passengers) {

		this.speed = maxSpeed;
		this.cost = price;
		this.psng = passengers;
		this.number = busNo;

	}

	public int getNumber() {
		return number;
	}

	public int getPsng() {
		return psng;
	}

	public String toString() {

		return (speed + " " + cost + " " + psng);

	}
}
<file_sep>package library;

public class Map extends Item{

	private String name;
	private boolean isAvailable;
	private int id;
	private String location;

	public Map(String name, boolean isAvailable, int id, String location) {
		super(name, isAvailable, id);
		this.location = location;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public boolean isAvailable() {
		return isAvailable;
	}

	public void setAvailable(boolean isAvailable) {
		this.isAvailable = isAvailable;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getLocation() {
		return location;
	}

	public void setLocation(String location) {
		this.location = location;
	}

}
<file_sep>package goldilocks;

public class Goldilocks {

	public static void main(String[] args) {

		int array[][] = { { 30, 50 }, { 130, 75 }, { 90, 60 }, { 150, 85 }, { 120, 70 }, { 200, 200 }, { 110, 100 } };
		int array2[][]= {{297,90},{66,110},{257,113},{276,191},{280,129},{219,163},{254,193},{86,153},{206,147},{71,137},{104,40},{238,127},{52,146},{129,197},{144,59},{157,124},{210,59},{11,54},{268,119},{261,121},{12,189},{186,108},{174,21},{77,18},{54,90},{174,52},{16,129},{59,181},{290,123},{248,132}};
		chairs(array2);
//System.out.println(array2.length);
	}

	public static void chairs(int array[][]) {
		int weight = 100;
		int temp = 120;
		for (int i = 0; i < array.length; i++) {
			int j = 0;
			if (array[i][j] > weight) {
				int k = 1;
				if (array[i][k] < temp) {
					System.out.println(i + 1);

				}
			}
		}
	}
}
