Answered step by step
Verified Expert Solution
Link Copied!

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

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

600 lb 20 0.5 ft 30 30 5 ft

Answered: 1 week ago

Question

Why are employees considering union representation?

Answered: 1 week ago

Question

What is the total annual turnover rate?

Answered: 1 week ago