Question
Develop and test an Object-Oriented C++ program to process multi-word phrases and sentences in a variety of ways. In this case, the required processing includes
Develop and test an Object-Oriented C++ program to process multi-word phrases and sentences in a variety of ways. In this case, the required processing includes reversing the words in a phrase, sorting the words within the phrase in ascending order (sort the words, not the characters), and applying the Rot13 encoding to all the characters in the original phrase. Discussion: Phrases are composed of words, which are in turn composed of characters. In C++, those characters are represented as bytes, using the ASCII standard to encode each character as a number. Parsing a string involves breaking a string up into its component words, using spaces as the delimiters between words. So this project requires first that the users input phrase be parsed into its component words, and then each word must be handled as an individual entity. In all the phrase processing, words must be intact. Consider the following issues when preparing your solution. Create a user-defined Phrase class to manage a phrase and the words within it. This class must have one or more constructor(s) for initialization and multiple methods to perform the various operations on the phrase and its words. Create a single instance of the class in function main() Repeat the following steps until the user opts to quit: o Prompt the user for a string or sentence, and read it into a single string o Initialize the Phrase object with the user-input phrase o Display the following conversions of the user-input phrase as produced by public methods of the Phrase class. Capitalization must be preserved from the input phrase to each of these conversions. Reversed word order Sorted word order Rot13 Coding Each class must be defined within its own set of .h and .cpp files.
Use the provided main() function, with your own edits and additions, to complete this project.
The program must accept any string, including embedded spaces, as input. Validate all inputs and do not proceed until valid values are entered.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started