A little help please. Switch statement?

Well hey there,
I have some code and I would like to know why it keeps skipping to a certain part.
I have made code for a cinema booking system and ticket prices are;
Adult £5
Student £4
Child £3
But no matter which I choose the price is £5?
                                        if ((input1 != null) && (input1.length() > 0)){
                                            char choice;
                                            choice = input1.toLowerCase().charAt(0);
                                            int selectedprice;
                                            switch(choice){
                                                case 'a':
                                                    selectedprice = 5;
                                                case 's':
                                                    selectedprice = 4;
                                                case 'c':
                                                    selectedprice = 3;
                                                default: selectedprice = 5;I know I have a default price of £5 but how can I make it so there is no default and it goes on what the user chooses? Thanks.

if ((string2 != null) && (string1.length() > 0)){
                        Object[] possibilities3 = {"Adult", "Student", "Child"};
                                String input1 = (String)JOptionPane.showInputDialog(
                                        frame, "Please Select Ticket Type: ",
                                        "Ticket Booking", JOptionPane.PLAIN_MESSAGE, null, possibilities3, "" );
                                        if ((input1 != null) && (input1.length() > 0)){
                                            char choice;
                                            choice = input1.toLowerCase().charAt(0);
                                            int selectedprice;
                                            switch(choice){
                                                case 'A':
                                                    selectedprice = 5; 
                                                    break;
                                                case 'S':
                                                    selectedprice = 4;
                                                    break;
                                                case 'C':
                                                    selectedprice = 3;
                                                    break;
                                                default: selectedprice = 0;
                                             String input2 = JOptionPane.showInputDialog(frame, "Please Enter Number of Tickets: ");
                                             Integer quantity = Integer.parseInt(input2);
                                             TicketPrice total = new TicketPrice(selectedprice, quantity);
                                             if ((input2 != null) && (quantity <= screen1.getCapacity()) ){
                                                 JOptionPane.showMessageDialog(frame, "Booking Confirmed! Payment of £" + total.getTotal() + " Transacted");
                                             else if ((input2 != null) && (quantity > screen1.getCapacity()) ){
                                                 JOptionPane.showMessageDialog(frame, "Booking Not Possible");
                                             else if ((input2 != null) && (quantity > screen3.getCapacity()) ){
                                                 JOptionPane.showMessageDialog(frame, "Booking Not Possible!");This is most of the code, it always says the price is £5 for any ticket? Please help.
Edited by: sabertoothed.tiger on Dec 10, 2008 4:56 PM

Similar Messages

  • Little help please with forwarding traffic to proxy server!

    hi all, little help please with this error message
    i got this when i ran my code and requested only the home page of the google at my client side !!
    GET / HTTP/1.1
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
    Accept-Language: en-us
    UA-CPU: x86
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.2; .NET CLR 2.0.50727)
    Host: www.google.com
    Connection: Keep-Alive
    Cookie: PREF=ID=a21457942a93fc67:TB=2:TM=1212883502:LM=1213187620:GM=1:S=H1BYeDQt9622ONKF
    HTTP/1.0 200 OK
    Cache-Control: private, max-age=0
    Date: Fri, 20 Jun 2008 22:43:15 GMT
    Expires: -1
    Content-Type: text/html; charset=UTF-8
    Content-Encoding: gzip
    Server: gws
    Content-Length: 2649
    X-Cache: MISS from linux-e6p8
    X-Cache-Lookup: MISS from linux-e6p8:3128
    Via: 1.0
    Connection: keep-alive
    GET /8SE/11?MI=32d919696b43409cb90ec369fe7aab75&LV=3.1.0.146&AG=T14050&IS=0000&TE=1&TV=tmen-us%7Cts20080620224324%7Crf0%7Csq38%7Cwi133526%7Ceuhttp%3A%2F%2Fwww.google.com%2F HTTP/1.1
    User-Agent: MSN_SL/3.1 Microsoft-Windows/5.1
    Host: g.ceipmsn.com
    HTTP/1.0 403 Forbidden
    Server: squid/2.6.STABLE5
    Date: Sat, 21 Jun 2008 01:46:26 GMT
    Content-Type: text/html
    Content-Length: 1066
    Expires: Sat, 21 Jun 2008 01:46:26 GMT
    X-Squid-Error: ERR_ACCESS_DENIED 0
    X-Cache: MISS from linux-e6p8
    X-Cache-Lookup: NONE from linux-e6p8:3128
    Via: 1.0
    Connection: close
    java.net.SocketException: Broken pipe // this is the error message
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:115)
    at java.io.DataOutputStream.writeBytes(DataOutputStream.java:259)
    at SimpleHttpHandler.run(Test77.java:61)
    at java.lang.Thread.run(Thread.java:595)
    at Test77.main(Test77.java:13)

    please could just tell me what is wrong with my code ! this is the last idea in my G.p and am havin difficulties with that cuz this is the first time dealin with java :( the purpose of my code to forward the http traffic from client to Squid server ( proxy server ) then forward the response from squid server to the clients !
    thanx a lot,
    this is my code :
    import java.io.*;
    import java.net.*;
    public class Test7 {
    public static void main(String[] args) {
    try {
    ServerSocket serverSocket = new ServerSocket(1416);
    while(true){
    System.out.println("Waiting for request");
    Socket socket = serverSocket.accept();
    new Thread(new SimpleHttpHandler(socket)).run();
    socket.close();
    catch (Exception e) {
    e.printStackTrace();
    class SimpleHttpHandler implements Runnable{
    private final static String CLRF = "\r\n";
    private Socket client;
    private DataOutputStream writer;
    private DataOutputStream writer2;
    private BufferedReader reader;
    private BufferedReader reader2;
    public SimpleHttpHandler(Socket client){
    this.client = client;
    public void run(){
    try{
    this.reader = new BufferedReader(
    new InputStreamReader(
    this.client.getInputStream()
    InetAddress ipp=InetAddress.getByName("192.168.6.29"); \\ my squid server
    System.out.println(ipp);
    StringBuffer buffer = new StringBuffer();
    Socket ss=new Socket(ipp,3128);
    this.writer= new DataOutputStream(ss.getOutputStream());
    writer.writeBytes(this.read());
    this.reader2 = new BufferedReader(
    new InputStreamReader(
    ss.getInputStream()
    this.writer2= new DataOutputStream(this.client.getOutputStream());
    writer2.writeBytes(this.read2());
    this.writer2.close();
    this.writer.close();
    this.reader.close();
    this.reader2.close();
    this.client.close();
    catch(Exception e){
    e.printStackTrace();
    private String read() throws IOException{
    String in = "";
    StringBuffer buffer = new StringBuffer();
    while(!(in = this.reader.readLine()).trim().equals("")){
    buffer.append(in + "\n");
    buffer.append(in + "\n");
    System.out.println(buffer.toString());
    return buffer.toString();
    private String read2() throws IOException{
    String in = "";
    StringBuffer buffer = new StringBuffer();
    while(!(in = this.reader2.readLine()).trim().equals("")){
    buffer.append(in + "\n");
    System.out.println(buffer.toString());
    return buffer.toString();
    Edited by: Tareq85 on Jun 20, 2008 5:22 PM

  • Need a little help please    Airport Express

    Need a little help please.
    I am trying to set up a wireless network at my home using Airport Express.
    I have a regular phone line running in to I assume the modem. From there, there is an Ethernet cable running from that box to the back of the PC. My question is, I think, which of those do I unplug and plug into the Airport Express, the one on the back of the PC or the one that is in the back of the modem, or is this totally wrong.
    Any help would be appreciated…
    Thanks
    In advance…
    PS I have the manual but to me it is not very clear…

    Your connection sequence would look like this:
    Internet > Modem > AirPort Express >>>wireless to your computers.
    This means that you would unplug the cable that is now connected at the back of your PC and move that connection to the AirPort Express.
    Open Macintosh HD > Applications > Utilities > AirPort Utility
    Click Continue to follow the guided setup. On the third page, you will choose the option to "Create a wireless network" and continue the setup.

  • Guys, a little help please ???

    Guys, a little help please before i launch my new toys out of my pram   I've got the new apple TV, Ipad2, and IOS5 update. I'm trying to set up mirrorring , however, when i double click the home page and swipe, the only options it gives me are Ipad or Apple TV. The video shows that i should be able to simply click on mirrorring and whazam it appears on my TV... I can't get this option.... I've rebooted them (router, ipad 2 and Apple Tv) numerous times but still can't get it.......Can someone tell me what I'm doing wrong?
    Thanks

    Sounds as though the options you're getting are the standard Airplay output icons.
    Check current AppleTV software version in Settings>General>About
    Latest is 4.4.2 - there's a sticky at the top of the page about updating - if you're on 4.3 or lower just update from Settings.
    Maybe someone can confirm the video you mention is actually the correct way to invoke mirroring - link?
    (Yn anfodus heb iPad2 does dim syniad 'da fi os ydi'r Mirroring yn gweithio fel yn y fideo - oes linc i'r fideo, rhag ofn bod y fideo'n anghywir?)
    AC

  • I have iPhone 4.I uprage it to IOS 5.1.1 and i can't go into it because i have no service.A  little help,please ? :/, I have iPhone 4.I uprage it to IOS 5.1.1 and i can't go into it because i have no service.A  little help,please ? :/

    I have iPhone 4.I uprage it to IOS 5.1.1 and i can't go into it because i have no service.A  little help,please ? :/, I have iPhone 4.I uprage it to IOS 5.1.1 and i can't go into it because i have no service.A  little help,please ? :/

    Your phone is carrier locked to a carrier other than the one you are trying to use.
    It was apparently hacked to unlock it prior to your attempt to update. Updating has re-locked it to the original carrier.
    Contact them and find out what their policy is.

  • Help with Switch statements using Enums?

    Hello, i need help with writing switch statements involving enums. Researched a lot but still cant find desired answer so going to ask here. Ok i'll cut story short.
    Im writing a calculator program. The main problem is writing code for controlling the engine of calculator which sequences of sum actions.
    I have enum class on itself. Atm i think thats ok. I have another class - the engine which does the work.
    I planned to have a switch statement which takes in parameter of a string n. This string n is received from the user interface when users press a button say; "1 + 2 = " which each time n should be "1", "+", "2" and "=" respectively.
    My algorithm would be as follows checking if its a operator(+) a case carry out adding etc.. each case producing its own task. ( I know i can do it with many simple if..else but that is bad programming technique hence im not going down that route) So here the problem arises - i cant get the switch to successfully complete its task... How about look at my code to understand it better.
    I have posted below all the relevant code i got so far, not including the swing codes because they are not needed here...
    ValidOperators v;
    public Calculator_Engine(ValidOperators v){
              stack = new Stack(20);
              //The creation of the stack...
              this.v = v;          
    public void main_Engine(String n){
           ValidOperators v = ValidOperators.numbers;
                    *vo = vo.valueOf(n);*
         switch(v){
         case Add: add();  break;
         case Sub: sub(); break;
         case Mul: Mul(); break;
         case Div: Div(); break;
         case Eq:sum = stack.sPop(); System.out.println("Sum= " + sum);
         default: double number = Integer.parseInt(n);
                       numberPressed(number);
                       break;
                      //default meaning its number so pass it to a method to do a job
    public enum ValidOperators {
         Add("+"), Sub("-"), Mul("X"), Div("/"),
         Eq("="), Numbers("?"); }
         Notes*
    It gives out error: "No enum const class ValidOperators.+" when i press button +.
    It has nothing to do with listeners as it highlighted the error is coming from the line:switch(v){
    I think i know where the problem is.. the line "vo = vo.valueOf(n);"
    This line gets the string and store the enum as that value instead of Add, Sub etc... So how would i solve the problem?
    But.. I dont know how to fix it. ANy help would be good
    Need more info please ask!
    Thanks in advance.

    demo:
    import java.util.*;
    public class EnumExample {
        enum E {
            STAR("*"), HASH("#");
            private String symbol;
            private static Map<String, E> map = new HashMap<String, E>();
            static {
                put(STAR);
                put(HASH);
            public String getSymbol() {
                return symbol;
            private E(String symbol) {
                this.symbol = symbol;
            private static void put(E e) {
                map.put(e.getSymbol(), e);
            public static E parse(String symbol) {
                return map.get(symbol);
        public static void main(String[] args) {
            System.out.println(E.valueOf("STAR")); //succeeds
            System.out.println(E.parse("*")); //succeeds
            System.out.println(E.parse("STAR")); //fails: null
            System.out.println(E.valueOf("*")); //fails: IllegalArgumentException
    }

  • Help with switch statement

    Hello I have a copy of my code below. Everything compiles fine its just when the code gets to the switch statement I get an error saying
    Exception in thread "main" java.util.InputMismatchException
    at java.util.Scanner.throwFor(Scanner.java:819)
    at java.util.Scanner.next(Scanner.java:1431)
    at java.util.Scanner.nextInt(Scanner.java:2040)
    at java.util.Scanner.nextInt(Scanner.java:2000)
    at Sample.main(Sample.java:55)
    Something is not working right when the user enters an integer expression. what can I do to fix this?
    import java.util.*;
    import java.io.*;
    // Declare a public class
    public class Sample {
         public static void main (String[] args){
         //Declare Variables
         float float0, float1;
         int int0, int1;
         String mathSign;
         char charMathSign;
         Scanner sc = new Scanner(System.in);
         //Ask user to Enter FLoating-Point Number Expression
         System.out.println("Enter a simple floating-point expression: ");
         float0 = sc.nextFloat();
         mathSign = sc.next ();
         float1 = sc.nextFloat();
         if(mathSign.equals("+"))
         System.out.println(float0 + " + " + float1 + " = " + (float0 + float1));     
         else if(mathSign.equals("-"))
         System.out.println(float0 + " - " + float1 + " = " + (float0 - float1));
         else if(mathSign.equals("*"))
         System.out.println(float0 + " * " + float1 + " = " + (float0 * float1));
         else if(mathSign.equals("/"))
         System.out.println(float0 + " / " + float1 + " = " + (float0 / float1));
         //Ask the user to enter a simple floating point expression
         System.out.println("Enter a simple integer expression: ");
         int0 = sc.nextInt ();
         charMathSign = mathSign.charAt(0);
         int1 = sc.nextInt ();
         switch (charMathSign)
              case '+': System.out.println(int0 + " + " + int1 + " = " + (int0 + int1));
              break;
              case '-': System.out.println(int0 + " - " + int1 + " = " + (int0 - int1));
              break;
              case '*': System.out.println(int0 + " * " + int1 + " = " + (int0 * int1));
              break;
              case '/': System.out.println(int0 + " / " + int1 + " = " + (int0 / int1));
              break;
    [/code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    {color:#000080}Duplicate posting, please post all responses at{color}{color:#0000ff}
    http://forum.java.sun.com/thread.jspa?threadID=5219239{color}{color:#000080}
    db{color}

  • Help With Switch Statements

    Alrighty, so I have to do this assignment for my Java course, using a switch statement. The assignment is to have the user enter a number (1-5), and have the corresponding line of a poem be displayed. So if the user entered 1, "One two, buckle your shoe" would be displayed. This is what I have and it's giving me a huge problem:
    import java.util.Scanner;
    public class Poem
         public static void main(String[] args);
              Scanner kboard = new Scanner(System.in);
              System.out.println("Enter a number 1-5 (or 0 to quit).");
              int n = kboard.nextLine();
              switch (n);
                   case 1: System.out.println("One two, buckle your shoe.");
                   break;
                   case 2: System.out.println("Three four, shut the door.");
                   break;
                   case 3: System.out.println("Five six, pick up sticks.");
                   break;
                   case 4: System.out.println("Seven eight, lay them straight.");
                   break;
                   case 5: System.out.println("Nine ten, a big fat hen.");
                   break;
                   default: System.out.println("Goodbye.");
                   break;
    }This is giving me a HUGE string of errors. (Something like 45). I'm wracking my brain here trying to figure this out. Any help is greatly appreciated. Thanks!

    Well that solved a lot of the errors. Now all I get is this:
    --------------------Configuration: <Default>--------------------
    C:\JavaPrograms\Poem.java:8: <identifier> expected
    System.out.println("Enter a number 1-5 (or 0 to quit).");
    ^
    C:\JavaPrograms\Poem.java:8: illegal start of type
    System.out.println("Enter a number 1-5 (or 0 to quit).");
    ^
    C:\JavaPrograms\Poem.java:12: illegal start of type
    switch (n) {
    ^
    C:\JavaPrograms\Poem.java:12: <identifier> expected
    switch (n) {
    ^
    C:\JavaPrograms\Poem.java:14: orphaned case
    case 1: System.out.println("One two, buckle your shoe.");
    ^
    C:\JavaPrograms\Poem.java:30: class, interface, or enum expected
    }

  • Little help please regarding deleting files and folders...

    My wife has a MBP and has accumulated some old items in her documents folder that she'd like to delete. She has a USB mouse but the "right click" doesn't appear to work. She's running 10.4.11 and can't reveal the files in icon mode to facilitate dragging to trash. Certainly there is a sequence of keystroke commands that will allow these files to be effectively trashed, but our "control/delete", or "apple/delete", or "option/delete" doesn't do the trick after highlighting the subject file. Help please! TIA!

    To delete a file or folder, high light it then using the keyboard type Command Delete and that will delete it. If you have multiple files and/or folders the same keyboard commands apply.
    Regards,
    Roger

  • Switching from external Email server to Exchange, Understanding Dis-Joint, and a little help please

    I'm pretty new at installing exchange myself and have never done Exchange 2013
    While going through the install help online I came across disjointed domains. I think I'm over thinking this but here is what I have and what I want to do. Any other tips would be great as well. 
    Customer currently has a domain, internal dns and email through GoDaddy. Lets call it smallschool.com 
    Internally they have a new Active Directory (2012) and the domain is in.smallschool.com. There is no external DNS except GoDaddy. I plan to use that (if that's ok). 
    I have built a Hyper-V for Exchange 2013 and have installed pre-requisites. 
    My Current Question are...
    Do I need to set up dis-joint dns suffix and modify the msds-allowdnssuffix attribute? I have the instructions, I just don't know if this is a must or not with the domain names like they are.
    Am I going to run into any trouble switching GoDaddy's email to Exchange Server? Any Tips?
    Thank You, 
    fixitrod

    Hi fixitrod,
    Agree with Ed Crowley. If your original used domain is smallschool.com in GoDaddy, I suppose your email address would be
    [email protected]
    If that is the case, when you deployed a new AD domain with in.smallschool.com, we can create an accepted domain for smallschool.com in Exchange 2013. If you want to still use Godaddy for external message sending and receiving, you can create an external
    relay domain. For more information about configuring external relay fomain, please refer to:
    http://technet.microsoft.com/en-us/library/jj657491(v=exchg.150).aspx
    Regards,
    Winnie Liang
    TechNet Community Support

  • HT1918 a little help please...

    Hello!I have a question!I upgraded my iTunes today and now I have Itunes 5.1.1.Before that I just had to give a password and nothing else in order to download an app from iTunes.Now I am a little complicated.I'm trying to create a new account and I don't have a credit card.But there is no ''none'' option!I only download free apps and I'm not interested in buying anything.I tried to change the country option and the ''none'' option appeared!But now I don't know what this '' to redeem a code or gift certificate'' is.And I don't know what to do in order to continue...Could you please help me?

    Again sad, no replies -

  • Can't use google. Little help please

    For some reason I cannot use Google as a search engine or access its website. Would really like to resolve this. Any help is really appreciated.
    Things I have tried:
    1.) Ping google and it was successful
    The address it is using is 173.194.117.242
    To make things weird, if I use this numerical address in the search cue I in fact get access to the google website
    2.) I flushed the DNS in "Terminal"
    Not sure if that did anything. I read somewhere to try it
    Important background information
    When I enter google in my search function, I am directed to this page strangely http://122.132.196.148/33407BMULZ/dsawfffs.php?64198
    I do live in South Korea so that's why its in Korean. Basically it tells me I need to update google chrome (which I am not even using) or download some binary patch that really only is meant for Microsoft users so it doesn't work on my computer anyway.
    So...Why is it that I can reach 173.194.117.242 (google) but then am directed to that strange web page in korean when I use google as a search engine in my browser (firefox,safari)
    Thanks!

    Please review the options below to determine which method is best to remove the Adware installed on your computer.
    The Easy, safe, effective method:
    http://www.adwaremedic.com/index.php
    If you are comfortable doing manual file removals use the somewhat more difficult method:
    http://support.apple.com/en-us/HT203987
    Also read the articles below to be more prepared for the next time there is an issue on your computer.
    https://discussions.apple.com/docs/DOC-7471
    https://discussions.apple.com/docs/DOC-8071
    http://www.thesafemac.com/tech-support-scam-pop-ups/

  • HT201407 LITTLE HELP PLEASE

    tried to update my ipad 2 16gb with itunes's latest sftware now my ipad has crashed
    i am now trying to restore with itunes my brothers laptop and it says:
    'the ipad "ipad" could not be restored. this device isnt eligible for the requested build'
    please help quite frustrating

    Make sure iTunes is at its latest version.

  • WINDOWS VISTA 64BIT. a little help please!!!

    hi
    i am running windows vista 64 bit, my motherboard is Asus M3A32MVP, soundcard: Soundblaster Xfi, grapics card ATI 3870x2, processor AMD Athalon 6400 plus running on 4 gb of RAM
    as i read all the posts as to how vista does not have the decoding for the audio sound, i think i may have solved the problem that we need in order to get surround sound. everyone needs to take a look at power dvd 7 max ... which has all of the decoding/encoding software for 5./6./7. surround sound, which seems to be missing from vista's os as far as sound is concerned. I keep seeing the particular fix for the creative driver for xp 64 , and vista 64 which was released on 3/4/08. this will fix the 4g of ram problem. i also purchased the instalation cd for the xfi soundcard for vista which is avaliable through the creative web site... IS THERE ANYBODY OUT THERE THAT MIGHT BE RUNNING THE SAME TYPE OF CONFIGURATION AS I AM OR IF SIMULAR TO WHAT I HAVE...AND IF SO IS IT WORKING TO IT'S FULL CAPACITY...... MEANING NO PROBLEMS..... CAN ANYONE HELP ME WITH THIS BEFORE I PUT VISTA 64 BACK ON THE COMPUTER??
    Message Edited by gothdaze on 03-9-2008 03:59 PM

    Again sad, no replies -

  • SpellChecker Program - A little help please?

    Follwing is a spell checker program I've written. It reads from dictionary file(of correct words) and a user input file. The user input is compared against the contents of the dic file. If they do not match, incorrect words are outputted to the console window.
    The code compiles, but for some reason it is not recognizing my input files (i.e. receive "FileNotFoundError" exception.
    Anyone know why?
    Thanks!!
    import java.io.*;
    import java.util.StringTokenizer;
    public class SpellChecker
        private String inFileName;
        private String dictionaryFile;
        public SpellChecker(String aFilename, String aDictionary)
            inFileName = aFilename;
            dictionaryFile = aDictionary;
            File inFile = new File(inFileName);
            File dictFile = new File(dictionaryFile);
            String inputLine;
            String dicLine;
            StringTokenizer tokenizer;
            String token;
        try
            FileReader inReader = new FileReader(inFile);
            FileReader dicReader = new FileReader(dictFile);
            BufferedReader in = new BufferedReader(inReader);
            BufferedReader dicBuffer = new BufferedReader(dicReader);
            while(in.readLine() != null)
              inputLine = in.readLine();
              dicLine = dicBuffer.readLine();
              tokenizer = new StringTokenizer(inputLine);
              while(tokenizer.hasMoreTokens())
                token = tokenizer.nextToken();
                if(token.equals(dicLine) == false)
                  System.out.println(token);
        catch(FileNotFoundException fnf)
          System.out.println("You must enter an input file name.");
        catch(IOException e)
          System.out.println("Micellaneous IO Exception.");
          public static void main(String[] args)
          try
            String dicFile;
            String checkFile;
            BufferedReader buffread = new BufferedReader(new InputStreamReader(System.in));
            System.out.println("Please enter a dictionary file name");
            dicFile = buffread.readLine();
            System.out.println("Please enter name of file to be checked");
            checkFile = buffread.readLine();
            SpellChecker sc = new SpellChecker(checkFile,dicFile);
        catch(IOException e)
          System.out.println("Micellaneous IO Exception.");
    }

    Thanks!! Now I don't get the same error, but am getting a NullPointerException in 2 places.
    - in main() where I'm creating the SpellChecker object.
    - further up in while loop where I'm creating a StringTokenizer object with the "inputLine" value as a parameter.
    any ideas??

Maybe you are looking for

  • Email and calendar update error Nokia C7-00

    there is an email and calendar update and when i tried to do it my phone nokia c7-00 restarted and the update wasnt done and tried over and over again and the same issue still as it is

  • Album view issue.

    Does anyone know how to stop the album view from showing the track list of the first album of a given letter when quick searching?

  • How do i change aspect ratio in iMovie?

    I was sent a video whose aspect ratio is messed up-squished vertically. I imported it into iMovie anyway thinking I could correct it. I thought it would happen i the Export dialog where I input a custom size. But it hasn't worked.

  • Bluetooth freezing up when trying to pair with a bluetooth headset

    I recently got a Plantronics Voyager 520 and whenever I try to connect it with my MBP it like freezes, not the whole computer though. Whenever I move the mouse into the top right corner (where the time and stuff is) it does the spinning thingy to sho

  • Importing large number of images still broken in Lightroom 1.1

    It's deja-vu all over again :( Clean XP SP2 install, clean LR 1.1 install, new library Core 2 Duo, 4GB RAM, almost 2TB disk space 28,000 RAW images from Canon 10D, 1D Mark II and 1Ds Mark II I have a 30" screen so I set my library to: high quality pr