Question
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.
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 stringStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started