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
<html> | |
<head> | |
<title>Penney Game</title> | |
<style> | |
canvas{ border: 1px solid black; } | |
</style> | |
</head> | |
<body> |
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 TravelingSalesPerson | |
{ | |
public TravelingSalesPerson() | |
{ | |
String[] cities = {"Boston", "L.A.", "Las Vegas", "Atlanta", "Philadelphia", "Chicago", "Houston"}; |
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 Student | |
{ | |
int age; | |
String name; | |
int gYear; | |
private int ss; | |
final int YEAR_FOUNDED = 1785; | |
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 Upper extends Student | |
{ | |
public Upper(int g, String name) | |
{ | |
super(g, name); | |
System.out.println("You are an Upper Schooler"); | |
} |
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 Middle extends Student | |
{ | |
public Middle(int g, String name) | |
{ | |
super(g,name); | |
System.out.println("You are a Middle Schooler"); | |
} |
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 StudentStarter | |
{ | |
public static void main (String [] args){ | |
Student s; | |
Scanner sc=new Scanner(System.in); | |
int currYear = 2018; | |
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
/** | |
* A program to carry on conversations with a human user. | |
* This is the initial version that: | |
* <ul><li> | |
* Uses indexOf to find strings | |
* </li><li> | |
* Handles responding to simple words and phrases | |
* </li></ul> | |
* Tasks | |
* 1) handle response to good or bad moods |
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; | |
/** | |
* A simple class to run the Magpie class. | |
* @author Laurie White | |
* @version April 2012 | |
*/ | |
public class MagpieRunner | |
{ |
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
speed(10); | |
count = 0; | |
h = new Turtle(); | |
h.speed(1); | |
h.wear("dragon",20); | |
x = 0; | |
jumpto(250, 300); | |
while ((x < 4)) { | |
pen(orange, 10); | |
fd(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
ArrayList<String> kicks = new ArrayList<String>; | |
kicks.add("35:L:X", "45:R:O","27:L:O","50:R:X","22:O:R");//sample values below | |
int rcount = 0; | |
int lcount = 0; | |
for(int i = 0; i<kicks.size(); i++){ | |
int spot = kicks.get(i).indexOf(":"); |