Home Java Java-tips Data Strings Q-pr-string-using-loops Programming - Count Vowels - main

Ask Questions?

View Latest Questions

Advertisement


 
 

Programming - Count Vowels - main
Posted on: July 26, 2006 at 12:00 AM
Write a program that reads a string and displays the number of vowels in it.

Java: Programming - Count Vowels - main

Problem

Write a program that reads a string and displays the number of vowels in it. This main program program is primarily responsible for handling the input-output issues, and it will call a method to get the number of vowels.

Details

  • Loop. Read the input in a loop until the user hits Cancel or enters or a string with no characters in it (length 0). Display the number of vowels in each input string by (see below).
     
  • Call. You can call the following method, which you can assume is already written:
     
public static int countVowels(String text)
Advertisement


DMCA.com