Hi Norm, I finally got the program to work correctly.
String s1;
System.out.println(" Enter the String ");
s1 = input.nextLine();
s1 = toUpperCase();...
Type: Posts; User: willie lee
Hi Norm, I finally got the program to work correctly.
String s1;
System.out.println(" Enter the String ");
s1 = input.nextLine();
s1 = toUpperCase();...
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 =...
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...
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...
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++;
...
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...
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...
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...
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...
Norm, did you receive the contents from my command prompt window along with my comments?
Yes, this code compiles w/o errors.
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...
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"...
Here is my current code Norm.
import java.util.Scanner;
public class NewFoothill
{
public static void main(String[] args) throws Exception
{
Scanner input = new...
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
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...
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...
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...
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...