Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I would appreciate if you could help out with the extra credit as well! Write a C++program which will prompt the user to enter some

I would appreciate if you could help out with the extra credit as well!

image text in transcribedimage text in transcribed

Write a C++program which will prompt the user to enter some words and then sort the words in alphabetical order and display them. There is an extra credit option for this assignment Requirements: Name the source file for your program program7.cpp Store the words entered by the user in an array of strings (each element of the array is of type string) The maximum number of words for which the program needs to work must be set using the following constant (a global constant at the top of the program): const int NUM_WORDS - 10; Then, throughout the program wherever this size is needed, the constant must be used rather than a literal number 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 if the maximum number of words is reached, or if the user enters "O" as one of the words. If the user enters "O" to end the input sequence, then the "0" must not be counted as one of the words sorted and later displayed Sorting of the words must be done using the Bubble Sort method, implemented in a function with this prototype void bubbleSortstring words[], int num) This function must sort the first num strings of the words array from "smallest" to "largest" as determined by either the compare function (for any strings, whether of letters or not), or using the

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

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions

Question

3. You can gain power by making others feel important.

Answered: 1 week ago