Question: Draw a flow chart for the following java code import java.util.Scanner; public class VowelCounter { public static void main(String[] args) { int[] count= new int[5];
Draw a flow chart for the following java code
import java.util.Scanner; public class VowelCounter {
public static void main(String[] args) { int[] count= new int[5]; char[] vowels= new char[]{'a','e','i','o','u'}; System.out.println("Welcome to the vowel counter and sorter! " +"Enter a phrase!"); Scanner keyboard = new Scanner(System.in); String phrase= keyboard.nextLine();
String capphrase= phrase.toUpperCase();
for(int j=0;j for(int j=0;j<5;j++){ int min=findmin(count); // find the position of minimum element in array count System.out.println(vowels[min] +" "+ count[min]); count[min]=max+1; } } public static int findmin(int[] a) // returns the position of minimum element in the array a { int mins=0; for(int i=1;i public static int findmax(int[] a) //returns the position of maximum element in the array a { int maxs=0; for(int i=1;i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
