FYI The String class's charAt() method does that.
Type: Posts; User: Norm
FYI The String class's charAt() method does that.
Then you need to build a binary tree. Test a condition at a node, go left if true, go right if false.
Take a piece of paper and a pencil and work out the logic.
Leave off the else
Make a simple if statement to test if the letter is 'a' and increment the count if true.
Make 4 copies of that changing the letter being tested for in each if test for the next vowel
Would a series of if tests for the each of the vowels work?
Are you allowed to increment the counter in more than one place?
What I'm suggesting takes one if statement to test the results of the search for the single letter being in a String of desired letters.
If the assignment's requirements are that a tree of nested...
An easy way to see if a character is a member of a group of characters is to make a String of the group of characters and use a String method to see if the char to be checked is in the other String. ...
What methods and techniques can you use? I see the String class's charAt() and toLowerCase().
Can you use other String class methods? Can you have other Strings with reference data?