Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java String Builder Problem. I need the second input found in the StringBuilder to be converted to uppercase. The second input should be capitalized and
Java String Builder Problem.
I need the second input found in the StringBuilder to be converted to uppercase. The second input should be capitalized and if those same letters are found in the first string then they should be converted to uppercase letters. See required input and output below.
Here is what I have so far:
import java.util.Scanner; public class CaseDemo2 { public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); System.out.println("Enter some String"); StringBuilder sb = new StringBuilder(keyboard.nextLine()); System.out.println("Which letters should be converted to uppercase?"); String chars = keyboard.nextLine(); ParsingUtils.changeLetter(sb, chars); System.out.println(sb); } }
Standard Input | |
---|---|
aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz abcxyz |
|
Required Output
Enter a String Which characters should be converted to uppercase? AABBCCddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwXXYYZZ
Standard Input | |
---|---|
aaabbbcceeefghj abc |
|
Enter a String Which characters should be converted to uppercase? AAABBBCCeeefghj
Step 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