Question
Data Structures using JAVA. I'd like an expert help with this assignment. Thank You. In Exercise 14 you were asked to design and create an
Data Structures using JAVA. I'd like an expert help with this assignment. Thank You.
In Exercise 14 you were asked to design and create an IntLogInterface.
a. Using the same approaches developed in the text for the ArrayStringLog, create an ArrayIntLog class that implements the IntLogInterface.
b. Create an application called TestLuck that repeatedly generates random numbers between 1 and 10,000 until it generates the same number twice. The program should report how many numbers it had to generate before it matched a previously generated number. Your application should store generated numbers in an ArrayIntLog and use its contains method to test for matches.
public interface StringLogInterface
{
void insert( String element ) ;
/ / Precondition: This String Log is not full .
/ /
/ / Places element into this StringLog.
boolean isFull ( ) ;
/ / Returns true if this StringLog is full , otherwise returns false .
int size ( ) ;
/ / Returns the number of strings in this StringLog.
boolean contains ( String element ) ;
/ / Returns true if element is in this StringLog,
/ / otherwise returns false .
/ / Ignores case differences when doing a string comparison.
void clear ( ) ;
/ / Makes this StringLog empty.
String getName ( ) ;
/ / Returns the name of this StringLog.
String toString( ) ;
/ / Returns a nicely formatted string representing this StringLog.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started