Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a file called CountLetters.java. Inside your code, define a variable of type String called sentence, and set it equal to an English sentence of

Create a file called CountLetters.java. Inside your code, define a variable of type String called sentence, and set it equal to an English sentence of your choosing. Write code that counts the number of vowels (a, e, i, o, u) and consonants (all other letters) in your sentence. Always count the letter "y" as a consonant. Your code will be graded on whether it [10] : Compiles and runs. [1] : Uses a for-loop to cycle through all characters in the sentence. [2p] : Correctly counts the vowels and consonants, whether they are lower or upper case. [10] : Outputs the results to standard output using complete sentences. HINTS: - A String is enclosed in quotes. Example: String 9 = "What day is it?"; - A char is enclosed in sin

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

Design Operation And Evaluation Of Mobile Communications

Authors: Gavriel Salvendy ,June Wei

1st Edition

3030770249, 978-3030770242

More Books

Students also viewed these Programming questions

Question

Explain the principles of data governance.

Answered: 1 week ago

Question

Focus on your message to help you become a more confident speaker.

Answered: 1 week ago

Question

Consider your own interests and experiences when selecting a topic.

Answered: 1 week ago

Question

Search for topics on the Internet, in the media, and in books.

Answered: 1 week ago