OpenStudy (woodrow73):

Small Java Test For Fun

2 years ago
OpenStudy (woodrow73):

Place the right value in the String to get the program to return "pass". Been a little quiet around cs os for a while; feel free to respond with a different puzzle. ``` import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Scanner; import javax.swing.JOptionPane; public class Crypt { public static void main(String[] args) throws IOException { //######################################### String key = ""; //enter key here //######################################### key += "woodrow"; JOptionPane.showMessageDialog(null, "Your key: \'" + key + "\'"); File woodrow = new File("37399753deleteme.txt"); PrintWriter pw = new PrintWriter(woodrow); pw.println(key); pw.close(); Scanner in = new Scanner(woodrow); ArrayList<String> read = new ArrayList<String>(); while(in.hasNext()) read.add(in.nextLine()); in.close(); woodrow.delete(); CharSequence woodrowcs = "woodrow"; if(read.size() == 3) { if(read.get(2).contains(woodrowcs)) pass(); else fail(); } else fail(); System.exit(0); } public static void fail() { System.out.println("fail"); } public static void pass() { System.out.println("pass"); } } ```

2 years ago
OpenStudy (woodrow73):

Answer spoiler: ``` 01011100011011100101110001101110 ``` http://www.wordsmuggler.com/Smuggler/Decode

2 years ago
Similar Questions: