Answered step by step
Verified Expert Solution
Link Copied!

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 12-10 from pages 839 as follows:
1. Add a third C-string as name3[NAME_LENGHT].
2. Add a pair of cout/cin.getline() for the third string similar to the ones for first and second strings.
3. Add the appropriate case to the "if/else if" structure such that the three strings will be displayed in alphabetical order.
Hint: There are 6 possible cases (3!,3 factorial =3*2*1=6) for all complete permutations. The easiest way to test is to input the three strings as single letters like: "a","b", and "c". Your "if/else if" condition check should cover all 6 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 ( strcmp(name1,name2)0 && strcmp(name2,name3)0)
cout name1"" name2"" name3 endl;
else if ( strcmp(...
You have to complete the rest of the 5 "else if" condition. The last "else" can be used to display the message that all three strings are the same.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Publishing With Filemaker Pro On The Web

Authors: Maria Langer

1st Edition

0201696657, 978-0201696653

More Books

Students also viewed these Databases questions

Question

=+b. Calculate the value of the estimated standard deviation se

Answered: 1 week ago