Write a program to test the new class

Assignment Help Basic Computer Science
Reference no: EM13978725

Write two interfaces, IWordStructure and IOrderedWordStructure.
IWordStructure should have the following methods:

a read-only property: numberOfWords that returns an integer
insertWord (string)

includesWord(string) and that returns a boolean
deleteWord(string) and return boolean indicating the success

IOrderedWordStructure should inherit from IWordStructure. It should have the following methods:

wordAt(nt) that returns the word at the index location
positionContains (string, int) returns a boolean

After writing the interfaces, create a collection class named StringCounter. It should implement the IOrderedWordStruture, mentioned above. It should have the following methods:
wordList, which returns an array containing the strings in the collection

CountEntry, which has three parameters. The first is a zero-based index indicating the position in the collection for which data is to be returned. The next two parameters are out mode. The first is used to return the string at the index position. The second is used to return the count for the string being returned in the second parameter.

These are additional requirements:

Use an array of structs to keep the data (the struct type should be like the one used in-class when writing the WordCount program; which is on the I: drive)(note : the file on the attachment )

The array should initially be able to hold 10 entries. Whenever the array fills up and additional locations are needed, allocate a new array twice the size of the one that is full, copy the entries in the old array to the new one, and let the old array be deallocated.

Write a program to test the new class. The class will be used in a late lab.

Attachment:- wordcountprogram.txt

Reference no: EM13978725

Questions Cloud

What is the final momentum of the car : Two men pushing a stalled car generate a net force of +688 N for 7.09 s. What is the final momentum of the car?
Psychological theories and principles in anxiety disorders : Choosing what area (3 of the below) of anxiety disorders begins with examining the following areas related to the course competencies. The major psychological theories and principles in the field of anxiety disorders and  The historical link to mode..
Draw and label the appropritate free-bodu diagrams : Draw and label the appropritate free-bodu diagrams. If the acceleration of the mass is 2.5 m/s2, determine the tension in the spring.
Provide the definition of the concept : Provide the definition of the concept. Discuss how and when the concept could be used by EEC. Discuss the advantages and disadvantages of the concept as it relates to EEC.
Write a program to test the new class : After writing the interfaces, create a collection class named StringCounter. It should implement the IOrderedWordStruture, mentioned above. It should have the following methods
Draw a graph to visualize the optimum : Repeat parts (a) and (b) for each of the following changes to the problem. The changes below are not cumulative (for each change, all other parameters revert to their values from original problem). For each case below, explain how the value of the..
Risk factors for organizations-analysis of audit risk : Determine risk factors for organizations based on analysis of audit risk, audit evidence, and financial statement assertions. Develop strategies to mitigate potential risk factors using organizational internal controls
Find moment of inertia of the system with respect to axis : Calculate the moment of inertia I of the system with respect to the axis going through mass m1 perpendicularly to the direction of L. Same for m2.
Describe the symptoms of the difficulties experienced : Name and describe the symptoms of the difficulties experienced by each of these women. Provide a tentative diagnosis based on the limited information you have in the case

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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