Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: I need help

  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question I need help

    Ok, so i wasn't sure if this was the right forum for JCreator or not, but i need help badly.

    Jcreater gives me 2 compiler errors,

    ')' expected (line 59)

    ';' expected (line 59)

    Code:
    import static java.lang.System.*;
    import java.util.*;
    
    public class Java2207
    {
    	public static void main(String[] args)
    	{
    		Problem07 parse = new Problem07();
    		parse.input();
    		parse.dataChopper();
    		parse.output();
    	}
    }
    
    class Problem07
    {
    	String dataLine;
    	int count;
    
    
    	void input()
    	{
    		Scanner scan = new Scanner(in);
    
    		out.println("Enter letters separated by a colon: ");
    		dataLine = scan.nextLine();
    	}
    
    	void dataChopper()
    	{
         	Scanner chopper = new Scanner(dataLine);
    
         	chopper.useDelimiter(":");
    
         	while(chopper.hasNext())
         	{
    
         	String word = chopper.next();
    
    		if(dataline.equalsIgnoreCase("a") || dataline.equalsIgnoreCase("e") || dataline.equalsIgnoreCase("i") || dataline.equalsIgnoreCase("o")  dataline.equalsIgnoreCase("u"))
    
    		count++;
         	}
    
    
    
    
    	}
    
    	void output()
    	{
    		out.println();
    		out.println("You entered " + count + " vowels.");
    		out.println();
    	}
    
    }

  • #2
    Regular Coder Apothem's Avatar
    Join Date
    Mar 2008
    Posts
    380
    Thanks
    36
    Thanked 25 Times in 25 Posts
    Did you look at the line? I believe it's something related to:
    Code:
    .... || dataline.equalsIgnoreCase("o")  dataline.equalsIgnoreCase("u"))

  • #3
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Yes, that is line 59, but i have no clue whats wrong with it. (im a nub at this stuff)

  • #4
    Regular Coder Apothem's Avatar
    Join Date
    Mar 2008
    Posts
    380
    Thanks
    36
    Thanked 25 Times in 25 Posts
    You need one more or (||) in between that.

  • Users who have thanked Apothem for this post:

    virtualpolecat (01-22-2012)

  • #5
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thank you, But it arises more problems. time to fix those.

  • #6
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    THANKS SO MUCH! I fixed it, couldn't have done it without your help, thanks again.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •