Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Ask the user to enter a string. Print how many different vowels there are in the string (e.g. aaaee has 2 different vowels). Ignore case,

Ask the user to enter a string. Print how many different vowels there are in the string (e.g. "aaaee" has 2 different vowels). Ignore case, i.e. 'A' and 'a' are considered to be the same vowel. 'y' is not considered a vowel. Look at the examples of output below and match them. Example: When the user enters the string: "It's Owl Stretching Time" the program should say that there are 3 different vowels in the string. DO NOT USE LOOPS. 

Hint

You could solve this problem by using a method of String that allows you to decide whether a certain String (say "e") appears in another String (say "It's Owl Stretching Time"). All methods of String can be found in the API.

Examples

% java CountVowels enter a string: Ask the user to enter a string.

there are 5 different vowels in string: "Ask the user to enter a string."

% java CountVowels enter a string: Print how many different vowels

there there are 4 different vowels in string: "Print how many different vowels there"

% java CountVowels enter a string: are in the string (e.g. "aaaee" has 2 different vowels).

there are 4 different vowels in string: "are in the string (e.g. "aaaee" has 2 different vowels)."

% java CountVowels enter a string: 123456

there are no vowels in string: "123456"

% java CountVowels enter a string: xxxxxAccccc

there is one vowel in string: "xxxxxAccccc"

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

Databases Illuminated

Authors: Catherine Ricardo

2nd Edition

1449606008, 978-1449606008

More Books

Students also viewed these Databases questions

Question

5. What decision-making model would you advocate to this person?

Answered: 1 week ago

Question

6. What data will she need?

Answered: 1 week ago

Question

1. How did you go about making your selection?

Answered: 1 week ago