/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package test1exp; import java.io.*; import java.util.*; /** * * @author jcmt */ public class Test1exp { public enum BodySize { SMALL, MEDIUM, LARGE, VERYLARGE }; private Colors ic; private String msg; private SportsCars mySC; private Addition myCost; private Dog genericDog; private NotesFolder myFolder; public Test1exp(boolean folder) { myFolder = new NotesFolder(); } public Test1exp() { ic = Colors.RED; msg = ""; mySC = new SportsCars(); } public Test1exp(Colors inic) { ic = inic; msg = ""; mySC = new SportsCars(inic); } public Test1exp(String inmsg) { ic = Colors.RED; msg = inmsg; mySC = new SportsCars(); } /* public boolean setMsg(String inmsg) { msg = inmsg; return true; } public String getMsg() { return msg; } private String colorSwitcher(Colors ic) { switch (ic) { case BROWN: return "Mmm, chocolate"; case BLUE: return "Like the sky"; case GREEN: return "Spring!"; case RED: return "Vampire! Run away!"; default: return "What color is that?"; } } * */ /** * @param args the command line arguments */ public static void main(String arg[]) { Test1exp mf = new Test1exp(true); Scanner input = new Scanner(System.in); boolean bpockets = true; String inPockets = new String(); System.out.println(mf.myFolder.toString()); System.out.println("Please enter information about the folder you use for the current class. "); System.out.println("Enter height as a decimal in inches: "); mf.myFolder.setHeight(input.nextDouble()); System.out.println("Enter width as a decimal in inches: "); mf.myFolder.setWidth(input.nextDouble()); System.out.println("Does the folder have pockets? Enter 'y' for yes or 'n' for no: "); inPockets = input.next(); if (inPockets.isEmpty()) { inPockets = input.next(); } if (inPockets.equalsIgnoreCase("Y")) { mf.myFolder.setPockets(true); } else if (inPockets.equalsIgnoreCase("N")) { mf.myFolder.setPockets(false); } else { System.out.println("The input was invalid so assuming folder has pockets."); mf.myFolder.setPockets(true); } System.out.println("How many paper fasteners does the folder have? : "); mf.myFolder.setFasteners(input.nextInt()); System.out.println("What material is the folder made out of? Use the codes below : "); System.out.println("P for paper"); System.out.println("C for cardboard"); System.out.println("O for poly"); System.out.println("G for glossy or printed cardstock"); System.out.println("M for miscellaneous"); mf.myFolder.setMadeOf(input.next()); System.out.println(mf.myFolder); /* File file = null; Test1exp eyeC = new Test1exp(Colors.BLUE); Test1exp eyeV = new Test1exp(); Window2Buttons bwin = new Window2Buttons(); bwin.AddBWindow(arg); */ /* Dog myBuddy = new Dog("Buddy"); Dog jaysRosie = new Dog(true, "Havanese", 'S', 'M', 4,"Rosie"); Dog timsJack = new Dog(true, "Bichon Frise", 'S', 'W', 8, "Jack", true); System.out.printf("Dog is %s age %d color %s \n",myBuddy.getName(), myBuddy.getAge(), myBuddy.getColor()); System.out.printf("Dog is %s age %d color %s \n",jaysRosie.getName(), jaysRosie.getAge(), jaysRosie.getColor()); System.out.printf("Dog is %s age %d color %s \n",timsJack.getName(), timsJack.getAge(), timsJack.getColor()); * */ // if (arg.length > 0) { // file = new File(arg[0]); // } // if (file == null) { // file = new File("textOutput.txt"); // } // System.out.println(file.toString()); // // Scanner scanner = null; // // try { // scanner = new Scanner(file); // } catch (FileNotFoundException e) { // System.out.println("File not found!"); // } finally { // System.out.println("Ready"); // } // //System.out.println(scanner.toString()); // // try { // while (!(scanner.hasNextInt())) { // scanner.next(); // } // // //System.out.printf ("Skip values in %s %n", file.toString ()); // //System.out.printf ("%n%n"); // %n gives a new line // // while (scanner.hasNext()) { // // System.out.printf("%3d /", scanner.nextInt()); // System.out.printf("%3d /", scanner.nextInt()); // System.out.printf("%5d %n", scanner.nextInt()); // System.out.printf("$%6.2f %n", scanner.nextFloat()); // // } // // } catch (InputMismatchException e) { // System.out.println("Mismatch exception:" + e); // } /* eyeC.setMsg(eyeC.colorSwitcher(eyeC.ic)); System.out.println(eyeC.getMsg() + " eyeC"); eyeV.setMsg(eyeV.colorSwitcher(eyeV.ic)); System.out.println(eyeV.getMsg()+" eyeV"); eyeC.mySC.printModnValue(); eyeV.mySC.printModnValue(); * */ } // main } // class