Question: Part 1 : ArrayList Develop a Java application to represent a Dictionary as a data structure using the Java built - in class ArrayList. Requirements:

Part 1 : ArrayList
Develop a Java application to represent a Dictionary as a data structure using the Java built-in class ArrayList.
Requirements:
(A) Write a class called Dictionary to represent a dictionary using ArrayList. Assume that the keys are strings (words) and the values are their corresponding definitions (also strings). This class should include the following instance variables:
An of type called for storing the dictionary keys.
An of type called for storing the corresponding definitions.
An integer variable to track the number of entries.
This class will have the following methods:
Constructor without parameters: Initializes the dictionary with a default capacity of 10.
Constructor with a parameter : Initializes the dictionary with the specified capacity.
Instance method : Returns the number of entries in the dictionary.
Instance method : Returns true if the dictionary is empty, false otherwise.
Instance method : Accepts parameters for a key and its corresponding value. Adds the entry if the key does not already exist.
Instance method : Accepts a key and returns true if the key exists in the dictionary, false otherwise.
Instance method : Accepts a key and returns the corresponding value, or null if the key does not exist.
Instance method 'removeEntry`: Accepts a key and removes the associated key-value pair from the dictionary.
Instance method : Prints all key-value pairs in the dictionary.
(B) Write a class called that contains the method. Create an instance of the class, add several IT-related words with their definitions, and demonstrate the functionality of all methods by calling them in the 'main` method.
Output Sample:
Dictionary:
Algorithm: A procedure for solving problems.
Data Structure: How data is organized.
Database: A collection of data.
Cloud Computing: Computing services over the internet.
Framework: A structure for building applications.
Size of dictionary: 5
Is dictionary empty? false
Value for 'Database': A collection of data.
After removing 'Algorithm':
Dictionary:
Data Structure: How data is organized.
Database: A collection of data.
Cloud Computing: Computing services over the internet.
Framework: A structure for building applications.
Is 'Cloud Computing' a member? true
Is 'Algorithm' a member? false
Part 1 : ArrayList Develop a Java application to

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 Programming Questions!