Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Modify the program 1 2 - 1 0 from pages 8 3 9 as follows: 1 . Add a third C - string as name
Modify the program from pages as follows:
Add a third Cstring as nameNAMELENGHT
Add a pair of coutcingetline for the third string similar to the ones for first and second strings.
Add the appropriate case to the ifelse if structure such that the three strings will be displayed in alphabetical order.
Hint: There are possible cases factorial for all complete permutations. The easiest way to test is to input the three strings as single letters like: ab and c Your ifelse if condition check should cover all cases for the possible input order like: abc, acb, bac, bca, cab, cba. Regardless of the input order the output should be always abc.
First if condition check is like:
if strcmpnamename && strcmpnamename
cout name name name endl;
else if strcmp
You have to complete the rest of the "else if condition. The last "else" can be used to display the message that all three strings are the same.
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