Create a class called ParsingUtils. Add a static method: public static void changeLetter(StringBuilder sb, char letter) Convert all occurrences of the letter variable in the StringBuilder to upper case import java.util.Scanner; public class CaseDemo { public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); System.out.println("Enter a String"); StringBuilder sb = new StringBuilder(keyboard.nextLine()); System.out.println("Which character should be converted to uppercase?"); char c = keyboard.nextLine().charAt(0); ParsingUtils.changeLetter(sb, c); System.out.println(sb); } }
Create a class called ParsingUtils. Add a static method: public static void changeLetter(StringBuilder sb, char letter) Convert all occurrences of the letter variable in the StringBuilder to upper case import java.util.Scanner; public class CaseDemo { public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); System.out.println("Enter a String"); StringBuilder sb = new StringBuilder(keyboard.nextLine()); System.out.println("Which character should be converted to uppercase?"); char c = keyboard.nextLine().charAt(0); ParsingUtils.changeLetter(sb, c); System.out.println(sb); } }
Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter7: String Manipulation
Section: Chapter Questions
Problem 2E
Related questions
Question
100%
Create a class called ParsingUtils. Add a static method:
public static void changeLetter(StringBuilder sb, char letter)
Convert all occurrences of the letter variable in the StringBuilder to upper case
import java.util.Scanner;
public class CaseDemo {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
System.out.println("Enter a String");
StringBuilder sb = new StringBuilder(keyboard.nextLine());
System.out.println("Which character should be converted to uppercase?");
char c = keyboard.nextLine().charAt(0);
ParsingUtils.changeLetter(sb, c);
System.out.println(sb);
}
}
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage