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

Questions Cloud

Adolescents are motivated to commit crimes : explaining why some adolescents are motivated to commit crimes while others in similar circumstances are not. Support your explanation by applying at least two of the following individual theories of delinquency:
Research the cash management services : Research the cash management services available at three different commercial banks. Detail the different services available, the features of one particular service you believe to be the best, and the fees involved.
Explain how crc works at the data link layer : What are two reasons errors may occur at the data link layer?
Explain what is the total opportunity cost for a month : The interest rate on marketable securities is 8% per annum. There is a constant rate of cash disbursement and no cash receipts during the month. What is the total opportunity cost for a month based on the firm's current practice?
Create a class called word : 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.
Construct a process flow chart showing times : Construct a process flow chart showing times and all flows and how long does your process take after you have minimized the total time by doing as much concurrently as you can?
What rate of interest is puro co paying on the note : A partial amortization schedule for a five-year note payable that Puro Co. issued on January 1, 2010, is shown here: Accounting Period Principal Balance January 1 Cash Payment Applied to Interest Applied to Principal
Dance improvisational artist : Write a paper on a dance improvisational artist(Merce Cuttingham). I am interested in you illuminating a particular aspect of their movement philosophy in which you find fascinating and relating it to your own artistic interests and experiences.
Determine the total charge under each plan : Determine the total charge under each plan for this case: 114 minutes of day calls and 49 minutes of evening calls in a month.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Explaining formal risk assessment of desktop systems

As apart of a formal risk assessment of desktop systems in small accounting firm with limited IT Support, you have identified asset "integrity of customer and financial data files on desktop systems" and threat.

  Review and discuss methods for it managers to maintain

Review and discuss methods for IT managers to maintain their skills while gaining new managerial skills

  Explain main resources in management information systems

The three main resources in management information systems (MIS) are information, information technology, and people. Which of these three resources is the most significant?

  Use a random-number generator to pick each card

Your program must incorporate a two-dimensional array to represent the suit and the value of each card dealt to a player, keep track of which cards have been dealt to which player, and use a random-number generator to pick each card to be dealt to..

  Write a recursive method

public static boolean isSorted(List l) Write a recursive method that returns true if a linked list is sorted (nondecreasing) order and returns false otherwise. An empty list is considered to be sorted.

  Benefits of measures used to protect operating systems

Describe relative benefits and disadvantages of at least three different measures used to protect operating systems.

  Explain bec corporate is department

If you were the system analyst in BEC corporate IS department and you had recieved call from Carrie douglas about her Project idea,what would you suggest to Carrie?

  Calculate fourier transform of function

Given a function f(x) as follows: f(0) = 2, f(1) = 3, f(2) = 5, f(3) = 4. Calculate the Fourier Transform of f(x), i.e: F(0), F(1), F(2) and F(3)!

  Computing downtime in telephone per year

Telephone system has an availability of 99.999 percent. How much downtime is that per year? Express your answer in a way that is easy for someone to understand.

  Creating a payoff table for decision

Amy decided to select the best option which will minimize her total 36-month cost. Difficult is that Amy is not sure how many miles she will drive over next three years. Create payoff table for Amy's decision.

  Positive and negative characteristics of hybrid databases

A idea that several of the main database vendors have come up with is a hybrid database that integrates the concepts of both OO and Relational databases.

  Advantages of logging more information to alerts file

What are the advantages of logging more information to the alerts file? What are the disadvantages of logging more information to the alerts file?

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