Skip to content

Instantly share code, notes, and snippets.

@mmandersheid
mmandersheid / AList.java
Created March 11, 2010 15:38
A sort timer
import java.awt.*;
public class AList
{
private int data[];
private int howMany;
public AList(int length)
{
howMany = length;
@mmandersheid
mmandersheid / CharStack.java
Created March 11, 2010 15:34
Advanced postfix calculator
public class CharStack {
private char data[];
private int top;
public CharStack(){
data = new char[100];
top = -1;
}
public void push(char c){
data[++top] = c;
@mmandersheid
mmandersheid / BracketChecker.java
Created March 11, 2010 15:28
A bracket checker
import java.awt.*;
import java.awt.event.*;
public class BracketChecker extends EventPanel implements ActionListener, TextListener {
private TextField field;
private Label answerLabel, title, instructions;;
public BracketChecker(){
setBackground(Color.white);
@mmandersheid
mmandersheid / Calculator.java
Created March 11, 2010 15:25
A postfix calculator
import java.awt.*;
import java.awt.event.*;
public class Calculator {
private DoubleStack memory;
private CharStack operators;
private String postfix;
private double numbers[];
@mmandersheid
mmandersheid / AList.java
Created March 11, 2010 14:45
Saveable LinkedList java prog
import java.awt.*;
import java.io.*;
public class AList
{
private Node head;
public AList()
{
head = new Node ("<fake>", 0, null);
@mmandersheid
mmandersheid / AList.java
Created March 11, 2010 14:38
Simple LinkedList java prog
import java.awt.*;
public class AList
{
private Node head;
public AList()
{
head = new Node ("<fake>", -99, null);
}
@mmandersheid
mmandersheid / Temperature
Created November 21, 2008 15:47
Temperature (Zip Code)
import java.net.*;
import java.util.*;
public class Temperature {
public static void main(String[] args) throws Exception {
Scanner userInput = new Scanner(System.in);
System.out.println("Enter a zip code");
String zipcode = userInput.nextLine();
URL u = new URL("http://www.weather.com/weather/local/"+zipcode+"?lswe="+zipcode+"49855&lwsa=WeatherLocalUndeclared&from=searchbox_localwx");
Scanner webpage = new Scanner(u.openStream());
@mmandersheid
mmandersheid / House
Created November 12, 2008 16:01
House class
public class House {
private double houseTemp;
private static double outsideTemp;
public House (double houseTemp) {
this.houseTemp = houseTemp;
}
public static void setOutsideTemperature(double outsideTemp) {
House.outsideTemp = outsideTemp;
@mmandersheid
mmandersheid / Applet Class
Created November 9, 2008 23:48
Deck of Cards
import java.applet.Applet;
import java.awt.event.*;
import java.awt.*;
public class MyFirstApplet extends Applet implements KeyListener, MouseListener {
private Deck myDeck;
public void init() {
addKeyListener(this);
addMouseListener(this);