In Java create a class CharsToUnicodeWhile. Write code that reads from the user a string of characters and then prints them in Unicode. The user can quit the program by typing “Q' or “q”, otherwise the program stays in a loop and reads another string to convert it to Unicode. Use a while loop to test “Q' or “q” and a for loop to traverse the entered string, character by character. Hint: Initialize the while-loop condition BEFORE you enter the loop and update the while-loop condition AT THE END of the body of the loop.

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

 In Java create a class CharsToUnicodeWhile. Write code that reads from the user a string of characters and then prints them in Unicode. The user can quit the program by typing “Q' or “q”, otherwise the program stays in a loop and reads another string to convert it to Unicode. Use a while loop to test “Q' or “q” and a for loop to traverse the entered string, character by character. Hint: Initialize the while-loop condition BEFORE you enter the loop and update the while-loop condition AT THE END of the body of the loop.

The image shows the console output from a program designed to convert input strings into their corresponding Unicode values. This process demonstrates how text characters are mapped to numbers in the Unicode standard.

**Console Output Explanation:**

- **First Input:** The user types the string "abc".
  - **Conversion:** The characters "a", "b", and "c" are converted to Unicode, resulting in 97, 98, and 99, respectively.
  
- **Second Input:** The user types the string "xy".
  - **Conversion:** The characters "x" and "y" are converted to Unicode, resulting in 120 and 121, respectively.
  
- **Third Input:** The user types the string "1234".
  - **Conversion:** The characters "1", "2", "3", and "4" are converted to Unicode, resulting in 49, 50, 51, and 52, respectively.
  
- **Exit Command:** The user types "Q" to quit the program.

**Program Conclusion:**
- The system displays "Goodbye!" indicating the end of the program.
- The message "BUILD SUCCESSFUL (total time: 57 seconds)" is shown, confirming that the program executed successfully within 57 seconds.
Transcribed Image Text:The image shows the console output from a program designed to convert input strings into their corresponding Unicode values. This process demonstrates how text characters are mapped to numbers in the Unicode standard. **Console Output Explanation:** - **First Input:** The user types the string "abc". - **Conversion:** The characters "a", "b", and "c" are converted to Unicode, resulting in 97, 98, and 99, respectively. - **Second Input:** The user types the string "xy". - **Conversion:** The characters "x" and "y" are converted to Unicode, resulting in 120 and 121, respectively. - **Third Input:** The user types the string "1234". - **Conversion:** The characters "1", "2", "3", and "4" are converted to Unicode, resulting in 49, 50, 51, and 52, respectively. - **Exit Command:** The user types "Q" to quit the program. **Program Conclusion:** - The system displays "Goodbye!" indicating the end of the program. - The message "BUILD SUCCESSFUL (total time: 57 seconds)" is shown, confirming that the program executed successfully within 57 seconds.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Random Class and its operations
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