Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Define a class that represents a word list (list of words). The class contains the following member data: a. a string that stores the language

image text in transcribed
image text in transcribed
Define a class that represents a word list (list of words). The class contains the following member data: a. a string that stores the language of the words (Ex: English, French, Spanish.....). b. an integer (size) that keeps track of how many words are in the list. c. An integer (Max_Words) that contains the maximum number of words the list can hold. Max_Words is entered by the user once the list is created. d. an array of size (MAX_WORDS) that can store 50-character strings to hold the words. Define the following member functions in the class (WordList): a. A constructor: Takes an integer (with a default value of 10 ) as a parameter and sets the Max_Words to the value of that integer. Also, the constructor allocates the necessary memory for the words and sets the size to zero. b. Read_Word_List: Reads a number of words from keyboard into the list until the user enters the word "Stop". c. Add_Word: takes a word as a parameter. If the wordlist is already full, it displays the message "List full, word not added". If the word is already in the list, it leaves the list unchanged (it calls the function contains to check if it is in the list). Otherwise, it adds the word to the list and updates the number of words in the list. Do not bother keeping the list in order. d. Contains: takes a word as a parameter. If the word matches one of the wordList entries (words), the function returns true, otherwise it returns false. e. Operator==: overlaod (==) to check if two lists are the same. It returns true if the lists are in the same language, have the same number of elements, and every element of one list is found in the other. (You must call the function Contains in part d repeatedly.) If the lists are different it returns false. f. Sort_Word_List: This function sorts the words in a certain list in alphabetical order. g. Display_Word_List: displays all the words in the list in five columns. h. Copy constructor i. Overload the = operator so that you can assign one list to another in your program. 1 j. Overload the [] operator so that you can directly get a word at index (i) from the word list. k. Destructor: Returns the dynamically allocated memory in a list

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_2

Step: 3

blur-text-image_3

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 Driven Web Sites

Authors: Mike Morrison, Joline Morrison

1st Edition

061901556X, 978-0619015565

More Books

Students also viewed these Databases questions

Question

Explain the significance of labeling

Answered: 1 week ago