Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a class called StringManipulator. Create a single instance variable of type String for this class called line. (Because it will store a line of

Create a class called StringManipulator. Create a single instance variable of type String for this class called line. (Because it will store a line of text). Create a constructor for this class that accepts a single parameter as a String and initializes the instance variable line to this parameter. In the main method of your tester class, you will prompt the user for a line of text as a String (you can use the nextLine() method from the Scanner class), and use this String to construct a new StringManipulator object. Then you will call your methods. Use the following method names for each part of the problem. A) printUpper(), B) printEveryOther(), C) vowelsToUnderscore(), D) printVowelCount(), E) printVowelPositions(). These methods should each print the solution to each part of the problem, using the instance variable line for the calculations.

image text in transcribed

E6.3 Write programs that read a line of input as a string and print a. Only the uppercase letters in the string. b. Every second letter of the string. c. The string, with all vowels replaced by an underscore. d. The number of vowels in the string. e. The positions of all vowels in the string

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_2

Step: 3

blur-text-image_3

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

Audit Of The Safety Of Electrical Installations

Authors: Papa Samba Agne

1st Edition

6205799308, 978-6205799307

More Books

Students also viewed these Accounting questions

Question

7. Understand the challenges of multilingualism.

Answered: 1 week ago

Question

5. Give examples of variations in contextual rules.

Answered: 1 week ago