Question: Write a C++ program which will prompt the user for the size of their list, then to enter the words, and then sort the words

Write a C++ program which will prompt the user for the size of their list, then to enter the words, and then sort the words in alphabetical order and display them. Requirements: Name the source file for your program program8.cpp. Prompt the user for the number of words they would like to enter Dynamically allocate an array of strings (each element of the array is of type string) of that size. You can assume that each word entered by the user will not contain any spaces, so the words can be read in using cin >>. The program must stop prompting for further input once the maximum number of words is reached There is no need for the user to type 0 to indicate that they are finished. You have already asked them how many words they want to type, so that is how many words they will type Sorting of the words must be done using the Bubble Sort method, implemented in a function with this prototype: void bubbleSort(string words[], int num); This function must sort the num strings of the words array from smallest to largest as determined by the compare function (for any strings, whether of letters or not), which corresponds to alphabetical order if the strings are of letters. Dont do anything special to account for upper- or lower-case letters all upper-case letters will be considered as coming before all lower-case letters (this is known as lexicographic sorting).

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!