C++PROBLEM: Write a C++ program that will accept 3 strings (these should be of different sizes) then sorts them from least to highest number of characters. Your program should only accept a maximum of 15 characters and display a message if exceeded. SPECIFICATIONS: - All lines of codes should have a comment. TEST CASES: If a user inputs valid strings: Enter string 1: Cherries Enter string 2: Apple Enter string 3: Banana Result: Sorted Strings: Apple Banana Cherries If a user inputs not valid: Enter string 1: Apple Enter string 2: Apple Cherries Banana Result: Oooops! Exceeded the maximum number of characters!
C++PROBLEM: Write a C++ program that will accept 3 strings (these should be of different sizes) then sorts them from least to highest number of characters. Your program should only accept a maximum of 15 characters and display a message if exceeded. SPECIFICATIONS: - All lines of codes should have a comment. TEST CASES: If a user inputs valid strings: Enter string 1: Cherries Enter string 2: Apple Enter string 3: Banana Result: Sorted Strings: Apple Banana Cherries If a user inputs not valid: Enter string 1: Apple Enter string 2: Apple Cherries Banana Result: Oooops! Exceeded the maximum number of characters!
C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter9: Completing The Basics
Section9.3: The String Class
Problem 7E
Related questions
Question
C++PROBLEM:
Write a C++ program that will accept 3 strings (these should be of different sizes) then sorts them from least to highest number of characters. Your program should only accept a maximum of 15 characters and display a message if exceeded.
SPECIFICATIONS:
- All lines of codes should have a comment.
TEST CASES:
If a user inputs valid strings:
Enter string 1: Cherries
Enter string 2: Apple
Enter string 3: Banana
Result:
Sorted Strings:
Apple
Banana
Cherries
If a user inputs not valid:
Enter string 1: Apple
Enter string 2: Apple Cherries Banana
Result: Oooops! Exceeded the maximum number of characters!
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 4 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
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning