esign ASCII code of the first letters of each word to place them alphabetical order. Hint: Display the word that begins with ower ASCII value first, followed by the word that begins he higher ASCII value.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.5: A Closer Look: Loop Programming Techniques
Problem 14E
icon
Related questions
Question
Please help using java
4. Design a program that takes 2 words as input and uses the
ASCII code of the first letters of each word to place them in
alphabetical order. Hint: Display the word that begins with the
lower ASCII value first, followed by the word that begins with
the higher ASCII value.
For example: Sample Input: berry
apple
Sample Output: apple comes before berry
Test your program again, inputting the following data:
apple
Fix any problems that you find. (hint: use either the toLowerCase or
toUpperCase methods of the String class)
Berry
Transcribed Image Text:4. Design a program that takes 2 words as input and uses the ASCII code of the first letters of each word to place them in alphabetical order. Hint: Display the word that begins with the lower ASCII value first, followed by the word that begins with the higher ASCII value. For example: Sample Input: berry apple Sample Output: apple comes before berry Test your program again, inputting the following data: apple Fix any problems that you find. (hint: use either the toLowerCase or toUpperCase methods of the String class) Berry
Expert Solution
steps

Step by step

Solved in 5 steps with 4 images

Blurred answer
Knowledge Booster
Character class and its methods
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning