Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

import java util. Scanner; public class Lab7 public static void main (String[ args) //PART 1 Determine and print how many of each vowels appear in

image text in transcribedimage text in transcribed

import java util. Scanner; public class Lab7 public static void main (String[ args) //PART 1 Determine and print how many of each vowels appear in a string Scanner scan new Scanner System. in. System out.println ("Enter a string or type N"quitV" to exit:"); String line scan. nextLine //convert all characters to lower cases line J line toLowerCase while line equals "quit") false) //counter is used to count the number of vowels int counter 0; //Step 1-a: Complete the following for loop so that //the index i goes from the beginning of the string to the end //Hint: use length method for (int i 0; //Step1-b Complete the following if statement to check if //character is one of vowels a,e, i, o or u //Hint. use charAt method if (line.charAt (i) 'a' counter System out.println("The string line contains counter vowel (s)"); System out. println ("Enter a string or type "quit to exit line scan. nextLine //convert all characters to lower cases line line .toLowerCase System out.println ("InThe following is PART 2 "); this will create a new line

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions