Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Finding vowels help!

 
Vivian Chu
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to read a text file of words to find the words that have all 5 vowels in order (a then an e then an i, etc) Then I want to print all the words that do all the vowels.

I am having problems with what I have written so far!

 
Henry Wong
author
Marshal
Pie
Posts: 20907
76
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, what compilation errors are you getting? And how do you think it can be fixed?

Henry
 
Vivian Chu
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is saying

if(i = 'a') aisFound==true;

is not a statement.

I do not understand how to fix this?!?
 
Vivian Chu
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, I know I need to declare the variables aisFound, eisFound, etc. Did I do this correctly? I want them to to be False initially.
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is a vague error message. What it means (in this case) is that you have your equality test and assignment operators backwards. Use == (double equals) for testing equality and = (single equals) for assignment.
 
Vivian Chu
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I fixed the statement error, I am still confused on how to declare my variables: aisfound, etc.
 
Henry Wong
author
Marshal
Pie
Posts: 20907
76
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am still confused on how to declare my variables: aisfound, etc.


Well, how do you declare a variable? I am assuming that you taking a class, or reading a book about Java.

It is not very efficient to do it via trial and error.

Henry
 
Ls chin
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vivian Chu:
I fixed the statement error, I am still confused on how to declare my variables: aisfound, etc.


The 'true' or 'false' variable can only be boolean. Java keywords are also case sensitive. 'False' is not the same as 'false'.

Your code:


Did you get your comparison operator "==" mixed up with your assignment operator "="?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic