Search:

Type: Posts; User: Norm

Search: Search took 0.16 seconds.

  1. Re: Using a Loop and Nested Ifs to Count Number of Vowels in a String

    FYI The String class's charAt() method does that.
  2. Re: Using a Loop and Nested Ifs to Count Number of Vowels in a String

    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.
  3. Re: Using a Loop and Nested Ifs to Count Number of Vowels in a String

    Leave off the else
  4. Re: Using a Loop and Nested Ifs to Count Number of Vowels in a String

    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
  5. Re: Using a Loop and Nested Ifs to Count Number of Vowels in a String

    Would a series of if tests for the each of the vowels work?
  6. Re: Using a Loop and Nested Ifs to Count Number of Vowels in a String

    Are you allowed to increment the counter in more than one place?
  7. Re: Using a Loop and Nested Ifs to Count Number of Vowels in a String

    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...
  8. Re: Using a Loop and Nested Ifs to Count Number of Vowels in a String

    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. ...
  9. Re: Using a Loop and Nested Ifs to Count Number of Vowels in a 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?
Results 1 to 9 of 9