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

  Give a detail explanation of what vlans are

Give a detail explanation of what VLANs are.

  Build the erd for the present relationship

Build the ERD for the present relationship

  Determine the monthly charges for checking accounts

The billing department at the bank has asked for your team's help. They want to develop a program that will determine the monthly charges for checking accounts.

  Explain the conceptual model employed in the design

Explain the conceptual model employed in the design of these types. Describe the analogies and concepts these monitors expose to users, including the task-domain objects users manipulate on the screen.

  How to perform testing for each development method

Research, write, and give 4-6 page proposal of alternative methods Smith Consulting might consider for finishing Frequent Shopper Program. Describe how Smith would perform testing for each development method.

  Why is security of operation useful

1. Why is security of operation useful to overall information assurance

  Consecutive insertions into a binomial queue

1. When do M consecutive insertions into a binomial queue take less than 2M time units? 2. Suppose a binomial queue of N = 2k - 1 elements is built. Alternately perform M insert and deleteMin pairs. Clearly, each operation takes O(log N) time. Why do..

  Robot battle tank to battle against other tanks

Robocode is a programming game, where the goal is to develop a robot battle tank to battle against other tanks. You program a robot using the Java language, put it onto a battlefield and let it fight against opponent robots created by other progra..

  Use headers and sub-headers to segment breaks

Main Body of Information - Use Headers and Sub-headers to segment breaks in subject matter. Your content should include IT concepts, practices, terms, and illustrations presented in this course. Use critical thinking and explanatory discussions..

  Software developments for developers to analyze-design

The goal of real world software developments is for developers to analyze, design, program, and test complete applications that solve the needs of the customer.

  Describe digital forensics and process management.

Consider that Data Security and Policy Assurance methods are important to the overall success of IT and Corporate data security.

  How a virtual address in this machine is translated

how a virtual address in this machine is translated into a physical address, assuming that the MMU has an 8-entry fully associative TLB. Label all lines and show how many bits are in each part.

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