Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need Help. Please follow the commented instructions in the Dictionary.java file below: import java.util.ArrayList; //Import anything you need here public class Dictionary { // Declare

Need Help.

Please follow the commented instructions in the Dictionary.java file below:

import java.util.ArrayList; //Import anything you need here public class Dictionary { // Declare any variables you feel necessary here public Dictionary(/*DO NOT PUT ANY PARAMETERS HERE!*/) { // Initialise those variables } /*** * @return number of terms currently in the dictionary hint: starts at 0 when * there are no terms */ public int numberOfTerms() { return 0; } /*** * Add a Term to your dictionary, given a word and a definition, store them for * later use in your dictionary * * @param word * @param definition * */ public void addTerm(String word, String definition) { } /** * Implement functionality to retrieve a random term from your dictionary. This * could be used for a word of the day on a website. * * @return */ public Term getRandomTerm() { return null; } /** * Given a partial search string, check if any of the words you have stored match the given search string. * * If your dictionary contained Terms: apple, pineapple, paper, master. * * If search contained "ap" the results should be an ArrayList containing: apple, pineapple, paper. * * @param search * @return An ArrayList of Strings containing the results */ public ArrayList searchForWord(String search) { return null; } /** * Given a partial search string, check if any of the words you have stored start with a given character. * * If your dictionary contained Terms: apple, pineapple, paper, master. * * If c contained 'p' the results should be an ArrayList containing: pineapple, paper. * * @param search * @return An ArrayList of Strings containing the results */ public ArrayList searchForWordStartsWith(char c) { return null; } }

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_2

Step: 3

blur-text-image_3

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

Introduction To Database And Knowledge Base Systems

Authors: S Krishna

1st Edition

9810206208, 978-9810206208

More Books

Students also viewed these Databases questions