Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions 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)_
expand button
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:
expand button
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
Check Mark
Knowledge Booster
Background pattern image
Computer Science
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
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education