السسلام عليكم
عندي سسؤال في كتابة كود جافا بطريقة المصفوفه
احترت فيه كثير واود منكم المسساعده؟!!
هذا هوو السسؤال
Method Name : countNumberOfVowlesPerRow
Parameters : String [] words
Return : String[] Logic : The method will look in the words list , seach for the vowels in each row of words , and return the number of vowels per row .
vowels are : a or e or u or i or o
وهناااا محاولتي
public class Vowels
{
public static void main(String args [])
{
int text = getScannerInput.anInt("Enter a string: ");
System.out.println(countVowels(text));
}
int countVowels(String text)
{
int count = 0;
text = text.toLowerCase();
for (int i = 0; i < text.length(); i++) {
char c = text.charAt(i);
if (c=='a' || c=='e' || c=='i' || c=='o' || c=='u') {
count++;
}
}