Question: Restrictions: Unless directed otherwise, you cannot use any Java class libraries in this assignment. In particular any methods from the Arrays class. If needed cannot

 Restrictions: Unless directed otherwise, you cannot use any Java class librariesin this assignment. In particular any methods from the Arrays class. Ifneeded cannot use the ArrayList class nor can you use you maycreate and use one or more instances of an array and access

Restrictions: Unless directed otherwise, you cannot use any Java class libraries in this assignment. In particular any methods from the Arrays class. If needed cannot use the ArrayList class nor can you use you may create and use one or more instances of an array and access the length instance variable for each array you may use the Java Random class Of course you may use the System.print, println, and printf methods. - - In this project you will be doing the following Develop a java interface named Bag that can store a certain number of whole numbers in it. Abag in java is a kind of collection that does not do much more than contain its items. It does not order the items in any particular order and nor does it prevent duplicates Provide the following methods in the interface. getCurrentsize( that returns a count of numbers in the bag isEmpty)-that checks if the bag is empty, returns true when empty add (int num) - adds the number num to the bag * remove (int num) removes the first occurrence of the number num from the bag emoveremoves a randomly selected entry from the bag clear) removes all the numbers from the bag getFrequencyof (int num) -returns a count the number of times the number num exists in the bag *contains (int num) - Tests whether the bag contains the number num. Returns true when the pum is contained in the bag *tostring( )- returns a String of the contents of the bag equals (object o)returns a true if the parameter o exactly matches the contents of the bag i.e. same numbers in the same order) Design a java class called Scores that implements the Bag interface and provides implementation for all the methods inherited from the Baginterface. Do the following in the Scores class

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!