Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 3 [10 pointsl: Define a FixdLenStringList class that encapsulate a list of strings and a string length. All string in a FixdLenStringList have the

image text in transcribed

Exercise 3 [10 pointsl: Define a FixdLenStringList class that encapsulate a list of strings and a string length. All string in a FixdLenStringList have the same length. There is not limit on number of strings (dynamic array) that a FixdLenStringList can hold. For example, cc, and dd (all The FixdLenStringList listl may contain the strings aa, bb, strings of length 2) The FixdLenStringList list2 may contain the strings cat, dog, pig, fox bat, and eel (all strings of length 3) An incomplete implementation of the FixdLenStringList.java class is provided with this exercise: Here are the required methods in the FixdLenStringList class that you need to implement i Public constructor This constructor will have one parameter that will indicate the length of each string in FixdLenStringList's list. The constructor will initialize strLength with this value and will initialize FixdLenStringList's list of strings, possiblestrings, to have 0 entries. You are to implement the found method. This method returns true if its String parameter key is found in the list of strings, false otherwise. You are to implement the addstring method. This method will add a string to the FixdLenstringList's list if it is the correct length and not already in the list. If the string is already in the list or if the string is not the correct length, it is not added. HINT: you may call method found that is specified in part ii of this problem You are to implement the method removeRandomString that will remove and return a random string entry from FixdLenStringList's list of strings ii) iii) iv) Write a client test class for testing the FixdLenStringList class. Supply, your client class along with screen shots of some test runs

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Medical Image Databases

Authors: Stephen T.C. Wong

1st Edition

1461375398, 978-1461375395

More Books

Students also viewed these Databases questions