1) Write an appropriate java program that will: a. Return the length of the 4 strings. b. Compare String2 with String4 and determine if they are the same. c. Compare String2 with String 4 ignoring case and determine if they are the same. d. Convert Stings 1, 2, 3, and 4 to all upper case letters. e. Convert Strings 1, 2, 3, and 4 to all lower case letters.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
JAVA STRINGS
Let String 1 = "The quick brown fox jumps over the lazy dogs."
Let String 2 = "Mississippi"
Let String 3 = "Your Name" Enter your first and last name.
Let String 4 = "mississippi"
EXERCISES:
1) Write an appropriate java program that will:
a. Return the length of the 4 strings.
b. Compare String2 with String4 and determine if they are the same.
c. Compare String2 with String 4 ignoring case and determine if they are the sam
d. Convert Stings 1, 2, 3, and 4 to all upper case letters.
e. Convert Strings 1, 2, 3, and 4 to all lower case letters.
e.
2) Restore strings 1 to 4 to their original values. Find the character at index position 6 in
each string. (Put your guess first in the lines below and then check by writing the
appropriate Java code.)
Index position 6 for:
String 1:
String 3:
String 2:
String 4:
Determine what will be returned by charAt(3) and charAt(9) for each of the 4 Strings.
Write your answers first and then check by using the appropriate Java code.
charAt(3)
String1:
String2:_
String3:
String4:
charAt(9)
String1:
String2:
String3:
String4:
3) Use the appropriate method .concat(String s), create two new strings, String5 and String
6 that append String2 to String1 (for new String5) and and String4 to String 3. (New
String6) Show the results below.
String 5)_
String 6)_
Transcribed Image Text:JAVA STRINGS Let String 1 = "The quick brown fox jumps over the lazy dogs." Let String 2 = "Mississippi" Let String 3 = "Your Name" Enter your first and last name. Let String 4 = "mississippi" EXERCISES: 1) Write an appropriate java program that will: a. Return the length of the 4 strings. b. Compare String2 with String4 and determine if they are the same. c. Compare String2 with String 4 ignoring case and determine if they are the sam d. Convert Stings 1, 2, 3, and 4 to all upper case letters. e. Convert Strings 1, 2, 3, and 4 to all lower case letters. e. 2) Restore strings 1 to 4 to their original values. Find the character at index position 6 in each string. (Put your guess first in the lines below and then check by writing the appropriate Java code.) Index position 6 for: String 1: String 3: String 2: String 4: Determine what will be returned by charAt(3) and charAt(9) for each of the 4 Strings. Write your answers first and then check by using the appropriate Java code. charAt(3) String1: String2:_ String3: String4: charAt(9) String1: String2: String3: String4: 3) Use the appropriate method .concat(String s), create two new strings, String5 and String 6 that append String2 to String1 (for new String5) and and String4 to String 3. (New String6) Show the results below. String 5)_ String 6)_
4) Using the .replace(char oldChar, char newChar) method, replace every s character in
each of the strings with a z. Write the results below.
String1:
String3:
String2:_
String4:
5) Restore the strings one through 4 to their original values. Using the
substring(int start, int end) method, list the substrings returned for each of the four
strings if the values of (0, 4) and (3,8) are used. Write down what you think should
appear first and then check by programming the appropriate Java commands and check.
Substring (0,4)
String1:
String2:
String3:
String4:
Substring(3,8)
String1:
String2
String3:
String4:
Transcribed Image Text:4) Using the .replace(char oldChar, char newChar) method, replace every s character in each of the strings with a z. Write the results below. String1: String3: String2:_ String4: 5) Restore the strings one through 4 to their original values. Using the substring(int start, int end) method, list the substrings returned for each of the four strings if the values of (0, 4) and (3,8) are used. Write down what you think should appear first and then check by programming the appropriate Java commands and check. Substring (0,4) String1: String2: String3: String4: Substring(3,8) String1: String2 String3: String4:
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Function Arguments
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.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education