Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-22-2012, 03:14 PM   PM User | #1
virtualpolecat
New to the CF scene

 
Join Date: Jan 2012
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
virtualpolecat is an unknown quantity at this point
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();
	}

}
virtualpolecat is offline   Reply With Quote
Old 01-22-2012, 03:21 PM   PM User | #2
Apothem
Regular Coder

 
Apothem's Avatar
 
Join Date: Mar 2008
Posts: 380
Thanks: 36
Thanked 25 Times in 25 Posts
Apothem is an unknown quantity at this point
Did you look at the line? I believe it's something related to:
Code:
.... || dataline.equalsIgnoreCase("o")  dataline.equalsIgnoreCase("u"))
Apothem is offline   Reply With Quote
Old 01-22-2012, 03:28 PM   PM User | #3
virtualpolecat
New to the CF scene

 
Join Date: Jan 2012
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
virtualpolecat is an unknown quantity at this point
Yes, that is line 59, but i have no clue whats wrong with it. (im a nub at this stuff)
virtualpolecat is offline   Reply With Quote
Old 01-22-2012, 04:02 PM   PM User | #4
Apothem
Regular Coder

 
Apothem's Avatar
 
Join Date: Mar 2008
Posts: 380
Thanks: 36
Thanked 25 Times in 25 Posts
Apothem is an unknown quantity at this point
You need one more or (||) in between that.
Apothem is offline   Reply With Quote
Users who have thanked Apothem for this post:
virtualpolecat (01-22-2012)
Old 01-22-2012, 04:49 PM   PM User | #5
virtualpolecat
New to the CF scene

 
Join Date: Jan 2012
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
virtualpolecat is an unknown quantity at this point
Thank you, But it arises more problems. time to fix those.
virtualpolecat is offline   Reply With Quote
Old 01-22-2012, 04:54 PM   PM User | #6
virtualpolecat
New to the CF scene

 
Join Date: Jan 2012
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
virtualpolecat is an unknown quantity at this point
THANKS SO MUCH! I fixed it, couldn't have done it without your help, thanks again.
virtualpolecat is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:07 PM.


Advertisement
Log in to turn off these ads.