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

  Difference between winlogon and netlogon

In windows, following is a kind of defense needed for the attacks caused primarily by the usage of particular programming languages, Difference between WinLogon and NetLogon

  Examine the challenges of developing erp system

Examine the challenges of developing ERP system

  Write a program that reads three whole numbers

Write a program that reads three whole numbers and displays the average of the three numbers.

  Imagine you are a senior systems administrator

Imagine you are a senior systems administrator who has recently been given the task to help improve security of your company's IT infrastructure after a series of network security breaches. These breaches included someone accessing the network ..

  Problem regarding the constrained optimization

A company produces and sells four grades of industrial solvents - A, B, C, and D. The selling price per gallon of each grade of solventis $6.40, $5.00, $4.20, and $3.50 respectively.  Because of demand limitations, the company can sell at most 100..

  How many students in this group take every one

For any three of these courses, there are precisely 20 students who take each of them. For any four among these courses, there are precisely 10 students who take each of them. How many students in this group take every one among the five courses i..

  Add a prompt to the condosales

Add a prompt to the CondoSales application to ask the user to specify a (1) garage or a (2) parking space, but only if the condo view selection is valid

  Currently use expert systems

Select two (2) companies that currently use expert systems. Then, discuss the fundamental advantages and disadvantages of using expert systems instead of human expertise within the companies that you have selected. Provide a rationale to support your..

  Creating truly anonymous electronic cash requires a bank to

1. refers to preventing data delays or denials.integritysecrecynecessityreadinessnbspquestion 2 refers to protecting

  How can you perform table lookup on an array

1. How can you perform table lookup on an array? Your explanation should include one or two practical computing example(s) of table lookup on an array. Are there any alternatives to using an array in your example? 2. What are Arrays 3. What are the t..

  Draw the binary tree for it and indicate the last character

Draw the binary tree for it and indicate the last character in its preorder traversal

  Program that asks the user to enter two decimal numbers

Write a program that asks the user to enter two decimal numbers - The program should calculate and display the product and quotient of the two numbers. Use a function Product() to calculate the product.

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