Create a class called word

Assignment Help Basic Computer Science
Reference no: EM13215461

Give me a .cpp file that do the following:

1.Create a class called "word" which stores a word as a string (name) along with an integer equal to the number of times it was found in the file (numTimes = 1). In addition, the class will contain two pointers, one which will point to the next word object in the list (next) and the other one which will point to the previous word object in the list (previous).

2.Create an array of word objects. (suggested steps below)

1)Create a function that creates a count of unique words in the list (no repeats). Use this count as the size of your word array. It might be helpful to have a string array of unique words uwords with initial length 1000, and compare each word to the array's values and add any new unique words to the next empty spot in the array (a string's default value is NULL).

2)Create a bool function called inList(string) which returns true if the string already appears as a name of a word object in the list, and false otherwise.

3)Create a function called addWord(string) which will insert a new word object with name equal to the string parameter if it is not already contained in the list.

4)Do not include repeated words. If a repeated word is found then increment the numTimes counter of the word object.

3.You will also want to create a pointer startOfList which will point to the first word object in the list (which originally will be set to null).

4.Create a function called insert(word) which will insert a word object into the list, alphabetically according to the name of the word object.

1)For example, if your list currently contains the word objects with names "bubble", "cat", and "dog" and you call insert(newWord) with word object newWord whose name variable is "cobra", the function will insert this word object between the two word objects "cat" and "dog". This means the "next" pointer in the "cat" object will now point to the newWord object, the "previous" pointer in the newWord object will point to the "cat" object, the "next" pointer in the newWord object will now point to the "dog" object, and so on. To find the point of insertion, simply begin with the start of the list pointer and use the next (and previous) pointers to traverse the list and find the place for the word to be inserted.

2)Sty setting the startOfList to the first word in your list.

5.Create a function display(string) which prints to the file with name equal to the string parameter, an alphabetical list of all words contained in the list along with the number of times they appeared in the input file.

6.No error, use file input and output,pointers, classes, correctness of output file 3 points, correctness of list functions.

Reference no: EM13215461

Two consecutive integers n and n+1

it can be shown that if gcd (m, n) = 1 then φ(mn) = φ(m) φ(n). Using this property and the property that φ(p) = p -1 for prime, it is straightforward to determine the value

Restricting access to the use of communal property

Under what conditions would restricting access to the use of communal property, and thus, regulating the transformation of communal property into private property, be an eff

Company marketing department promotes

Your company's marketing department promotes the products and interacts with the customers, sales force, and supply chain. They are also in charge of forecasting sales for t

Write the definition of the function min and a program

write the definition of the function min and a program to test this function. Add the function max to the class arrayListType to return the largest element of the list. Also

Career portfolio development

At this point, you are going to prepare for potential interviews. For this assignment, research common interview questions for IT career opportunities, and post your opinion

Use electronic monitoring to measure employee productivity

A discussion of the current trend to use electronic monitoring to measure employee productivity, bearing in mind the theories of Taylor and McGregor. The key ethical issue

Personal identification number

Consider an automated teller machine (ATM) in which users provide a personal identification number (PIN) and a card for account access. Give examples of confidentiality, int

Internet domain names are linked to trademark issues

Internet domain names are linked to trademark issues. Technology makes it easy to copy and distribute music and movies without paying royalties. Business conducted on the in


Write a Review

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd