Search:

Type: Posts; User: willie lee

Search: Search took 0.11 seconds.

  1. Re: Java for loops to count vowels/consonants usinf the logic of the main

    Hi Norm, I finally got the program to work correctly.


    String s1;

    System.out.println(" Enter the String ");
    s1 = input.nextLine();

    s1 = toUpperCase();...
  2. Re: Java for loops to count vowels/consonants usinf the logic of the main

    Norm, thanks for your example. My program is counting white space and punct. I did the following:


    System.out.println(" Enter the String. ");
    String s1 = input.nextLine();

    s1 =...
  3. Re: Java for loops to count vowels/consonants usinf the logic of the main

    Norm, I do not understand how I should implement a separate counter for each thing I am counting. Could you please give me one example. In the meantime, I implemented aussiemcgr's suggestion. All...
  4. Re: Java for loops to count vowels/consonants usinf the logic of the main

    Aussiemcgr, I did what you suggested and all worked well concerning the proper counting of vowels and consonants. However, when I entered the target sentence (Welcome to Foothill.) the count of...
  5. Re: Java for loops to count vowels/consonants usinf the logic of the main

    Hi Norm, I changed my if statement in the for loop concerning consonants to read as follows:


    if (( c != 'a' ) && ( c != 'e' ) && ( c != 'i' ) && ( c != 'o' ) && ( c != 'u )
    {
    count++;
    ...
  6. Re: Java for loops to count vowels/consonants usinf the logic of the main

    aussiemcgr, I have changed my program as follows:


    import java.util.Scanner;
    public class NewFoothill
    {

    public static void main(String[] args) throws Exception
    {
    Scanner input...
  7. Re: Java for loops to count vowels/consonants usinf the logic of the main

    Norm, I entered a println inside my for loop for vowels just after the if statement about 'a'. I ended the loop just after 'a' and put in the println. A sea of red appeared but I continued with the...
  8. Re: Java for loops to count vowels/consonants usinf the logic of the main

    Norm, I think the problem with my code resides within the control variable of my for loop that counts the vowels. The loop vowel count is fine, but it jumps down to the loop that counts consonants...
  9. Re: Java for loops to count vowels/consonants usinf the logic of the main

    Norm, I posted it in the quick reply box. It looks like I will have to do it again. I am unable to paste to this site because I cannot get my script blocker to allow it. I will copy the command...
  10. Re: Java for loops to count vowels/consonants usinf the logic of the main

    Norm, did you receive the contents from my command prompt window along with my comments?
  11. Re: Java for loops to count vowels/consonants usinf the logic of the main

    Yes, this code compiles w/o errors.
  12. Re: Java for loops to count vowels/consonants usinf the logic of the main

    My code which I entered on 24/04/12 , 2351 hours (Thai time) compiles w/o errors. I use the Eclipse Europa. I edited my code so I hope it is now highlighted correctly and I corrected a miss...
  13. Re: Java for loops to count vowels/consonants usinf the logic of the main

    Hi Norm, I posted all the information you asked for a 2nd time in the quick reply section and it looks like I posted my code again in the wrong place. This time I am trying the "Reply to Thread"...
  14. Re: Java for loops to count vowels/consonants usinf the logic of the main

    Here is my current code Norm.


    import java.util.Scanner;
    public class NewFoothill
    {
    public static void main(String[] args) throws Exception
    {
    Scanner input = new...
  15. Re: Java for loops to count vowels/consonants usinf the logic of the main

    Norm, it is 9:33PM here and my wife is out of town and my 5 year old wants me to feed him so I must sign off. I will try to contact you tomorrow. Wille Lee
  16. Re: Java for loops to count vowels/consonants usinf the logic of the main

    Hi Norm, I got your reply and I did what you asked of me, but before I sent my new quick reply I went up and hit the thanks button before I sent my new reply with the code then I scrolled down to my...
  17. Re: Java for loops to count vowels/consonants usinf the logic of the main

    Thanks Norm for your reply. In each loop I separated each if statement. The loop that counts vowels works fine alone. I get the same good outcome when the loop that counts the consonants is alone...
  18. Re: Java for loops to count vowels/consonants usinf the logic of the main

    Norm thanks for your reply. I separated the if statements in each for loop. When I remove the loop that counts consonants my loop that counts vowels works fine and I get the same result when I...
  19. Java for loops to count vowels/consonants usinf the logic of the main

    When I enter 1 vowel the ans. is 1 vowel and 2 consonants. When I enter 1 vowel and 1 consonant the ans. is 1 v & 2 cons. When I enter 1 consonant the ans. is 0 v & 1 cons. If I enter the...
Results 1 to 19 of 19