I have made a program to count the number of vowels and consonants in an inputted string:

        Scanner in = new Scanner(System.in);


System.out.print("Enter a string ");
    String phrase = in.nextLine();

int i, length, vowels = 0;
int consonants = 0;
boolean y = false;
String j;
length = phrase.length();
for (i = 0; i &lt; length; i++)
{



        j = "" + phrase.charAt(i);


     boolean isAVowel = "aeiou".contains(j.toLowerCase());
     boolean y = "y".contains(j.toLowerCase());


     if(isAVowel){
         vowels++;
     }else if(isAVowel &amp;&amp; y){
     vowels++;
    consonants++;
//}else if(y &amp;&amp; !(isAVowel)){
//   vowels++;
      }else{
      consonants++;
      }


System.out.println("The number of vowels in \"" +phrase+"\" is "+ vowels+".\n\nThe number of consonants is "+consonants+".\n\n");


When "y" is by itself it says its a consonant, it should be a vowel. Where do I state this?


Question: Is an old mtb with replaced gear safe to buy?
Answer: With a mountain bike parts do wear out. I would be more cautious of a 10 year old bike with original parts unless it had original tires and I could still see the manufacturer 'tags' (i.e. like new) showing it had been ridden only once or twice and been a garage ornament for all but the first 2 weeks of its life.  

If the bike has been ridden regularly you will be wanting a well maintained one. This means parts replaced as they wear out or get damaged.  

I have bough several second hand MTB's - you get a better bike for you money than new. The ones I have always ended up buying have had many parts replaced, as its these bikes that the riders are using regularity and keeping well tuned and maintained.  

With respect to the edits - a leaking front fork could simply need a new seal or it could be a new fork - its a deal breaker for me.