Question: Below is the code for Lab04StringLinkedBag.java package lab04stringlinkedbag; /** * Tester for Lab 4 * Programmed by Stephen Brower * Inspired by Michael Main *

 Below is the code for Lab04StringLinkedBag.java package lab04stringlinkedbag; /** * Tester
for Lab 4 * Programmed by Stephen Brower * Inspired by Michael
Main * Date Modified 10/2/2012 - fixed the labels to match the
actions * 2/20/2013 - Changed Class Name * 6/20/2013 - changed calls
Below is the code for Lab04StringLinkedBag.java
package lab04stringlinkedbag; /** * Tester for Lab 4 * Programmed by Stephen Brower * Inspired by Michael Main * Date Modified 10/2/2012 - fixed the labels to match the actions * 2/20/2013 - Changed Class Name * 6/20/2013 - changed calls to remove to be in if * added comments * 2/19/2014 - added 2 more cheeses...mmm...cheese * - added comments to displayBag * 9/21/2014 - Split into Part 1 and Part 2 * 9/29/2015 - merged back to 1 part and arrayafied data * 10/1/2015 - for removes, now scans text of bag's toString() * to see if data is there * @author Stephen T. Brower */ public class Lab04StringLinkedBag { /** * The main method is the program's starting point. * @param args the command line arguments */ public static void main(String[] args) { // creates a linked bag StringLinkedBag cheeseBag = new StringLinkedBag(); //test data String[] stringsToAddArray = {"Swiss", "Colby", "MonteRey jack", "Cheddar", "Havarti", "MoNterey JAck", "Alpine Lace", "Wisconsin Cheddar"}; String[] stringsToFindArray = {"edam", "sWiss", "coLBy", "monTereY jaCk"}; boolean[] expectedFindResults = {false,true,true,true}; String[] stringsToCountArray = stringsToFindArray.clone(); int[] expectedCountResults = {0,1,1,2}; String[] stringsToRemoveArray = {"Edam", "Colby", "Alpine Lace", "Swiss"}; boolean[] expectedRemoveResults = {false,true,true,true}; // show initial bag displayBag("Display Bag on startup",cheeseBag); // add some cheeses to bag for (String stringToAdd : stringsToAddArray) addValue(stringToAdd,cheeseBag); // show bag after adds displayBag("Display Bag after adds",cheeseBag); // look for some cheeses for (int i = 0; i >\t>\t>\t

CISY 254 Lab 4-Linked Lists Due Saturday 2/27/2016 11:59 pm Monday/Thursday Purpose: To implement a linked list of Strings using the "Bag" approach Task: Write the StringNode class following the UML below and write the StringLinkedBag following the UML below. Test using the Lab04StringLinkedBag.java provided by the instructor (Lab 04 Files folder in Lab Files folder in Lion's Den) (.zip contains a NetBeans Project shell) NOTE: Tester assumes that toString() has been implemented correctly in StringLinkedBag UML UML for StringNode StringNode -data:String link: StringNode +String Node(initialData: String, initialLink StringNode) + getData0:String + getLink):StringNode + setData(initialData:String):void +setLink(initialLink String Node)void UML for StringLinkedBag StringLinkedBag head: StringNode numElements:int + StringLinkedBag) + getsize():int +toString)-String + add(element : String):void +exists(target: String): boolean + coun + remove(target: String): boolean es(target: String): int Note: This will be revisited and made generic in Lab 5, so consider this as a first-of-a-series prototype Submitting the Lab E-mail your StringNode.java and StringBag-java files to the instructor's email account at stephen.brower@raritanval.edu with a subject of CISY 254 Lab 4 see the syllabus for the Late Policy [ 3/3 last day for "life happens" J and Cheating Policies

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!