• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Finding vowels help!

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!

 
author
Posts: 23928
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 1844
Eclipse IDE Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 23928
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 "="?
 
It would give a normal human mental abilities to rival mine. To think it is just a tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic