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
#!/usr/bin/ruby | |
names = ["Spooky", "Elise", "Cinder", "Checkers", "Peaches"] | |
for x in 0...names.length | |
if names[x] == "Elise" | |
print names[x], " is a dog\n" | |
else | |
print names[x], "\n" | |
end | |
end |
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
#include <iostream> | |
#include <vector> | |
#include <map> | |
#include <sstream> | |
#include <string> | |
#include <fstream> | |
using namespace std; | |
// split space delimited string and return vector | |
vector<string> makeList(string input) { |
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 Encrypt { | |
public static void main(String[] args) { | |
// Lower a-z: 97-122; Higher A-Z: 65-90; Numbers 48-57 (0-9) | |
Scanner input = new Scanner(System.in); | |
System.out.printf("Encrypt:\t\t"); | |
// nextLine is crucial, without it, it will only read the first word, not the entire string (including spaces) | |
String phrase = input.nextLine(); |
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.List; | |
import java.util.regex.*; | |
public class BufferBuilder { | |
public static void main(String[] args) { | |
// Initialize variables | |
String defaultParagraph = "Welcome to the Fall 2012 semester. We are learning object oriented programming in CSCI 1302."; | |
// Call methods |
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.List; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
public class SimpleWordProcessor { | |
public static void main(String[] args) { | |
String phrase = "Welcome to the Fall 2012 Semester. We are learning Object-Oriented Programming in CSCI 1302."; |
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
package Union; | |
import java.io.*; | |
import java.util.*; | |
import java.util.regex.*; | |
// need method for counting [tT]he, need to replace word counting method with more efficient counter (see countPreps) | |
public class DataStreams { | |
public static void main(String[] args) throws IOException { |
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.awt.*; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import java.io.FileNotFoundException; | |
import java.io.PrintWriter; | |
import java.io.FileReader; | |
import java.io.IOException; | |
import javax.swing.*; |
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 javax.swing.*; | |
import java.awt.*; | |
import java.awt.event.*; | |
public class GUI extends JFrame { | |
JTextArea textToFile; | |
GUIFileIO fileWriter; |
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.awt.*; | |
import java.awt.event.*; | |
import javax.swing.*; | |
import java.io.*; | |
public class TextEditor extends JFrame { | |
public TextEditor() { | |
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 javax.swing.*; | |
public class OutputGUI extends JPanel{ | |
private String message = "Hello"; | |
private JTextArea outMessage = new JTextArea(message, 20, 50); | |
public OutputGUI(){ | |
outMessage.setWrapStyleWord(true); |