Question: In C++ please! Warning: do not use vectors in this exercise. Write a program that takes as input an array of 5 strings (single words

In C++ please!

Warning: do not use vectors in this exercise.

Write a program that takes as input an array of 5 strings (single words separated by spaces). The program then swaps the word that comes first alphabetically with the word that comes last, and print the resulting array. For example, if the input is

Alpha Bravo Charlie Delta Echo 

The output will be

Echo Bravo Charlie Delta Alpha 

If the input is

Bravo Echo Charlie Alpha Delta 

then the output will be

Bravo Alpha Charlie Echo Delta 

Hint: you may directly compare two string variables using > or

Any attempt to hard code answers will result in a 0 for the exercise.

In C++ please! Warning: do not use vectors in this exercise. Write

Warning: do not use vectors in this exercise. Write a program that takes as input an array of 5 strings (single words separated by spaces). The program then swaps the word that comes first alphabetically with the word that comes last, and print the resulting array. For example, if the input is Alpha Bravo Charlie Delta Echo The output will be Echo Bravo Charlie Delta Alpha If the input is Bravo Echo Charlie Alpha Delta then the output will be Bravo Alpha Charlie Echo Delta Hint: you may directly compare two string variables using > or

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!