JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Created by Diego Becerril
//
// Response to: Diego Becerril
// Link: https://www.sololearn.com/Discuss/2679293/why-my-output-is-always-0
// Topic: How to recursively count vowels in a string.
//
// Created by Diego Becerril -- modified by Jegix.
//
public class Program
{
public static void main(String[] args) {
System.out.println(
new Exam().show("rayut".toCharArray(), 0)
);
}
}
public class Exam {
public int show(char[] c, int n) {
int cont = 0;
if (n < c.length) {
switch (c[n]) {
// Fall-Through
case 'a':
case 'e':
case 'i':
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run