Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

cop3xxxAssgn5

mary123
mary123 


Write a menu driven program that either accepts words and their meanings, or displays the list of words in lexicographical order (i.e. as in a dictionary). When an entry is to be added to the dictionary you must first enter the word as one string, and then enter the meaning as separate string. A word may have more than one meaning, and may be entered at separate times. When this occurs, place each successive meaning on a separate line. This new meaning must be preceded by a dash. For example, if you enter the following words and with their meanings in the following order: Library, School, Cup, and School, then your output should be a display as shown in the Figure 1. Attachments Tags Clarifications

Answers

Dictionary

felo
felo 



a menu driven program that either accepts words and their meanings, or displays the list of words in lexicographical order. Attachments
Dictionary.java (4 K) Download Preview
JScrollPane scrollPane = new JScrollPane(text); scrollPane.setPreferredSize( new Dimension(300, 300)); JOptionPane.showMessageDialog(this, scrollPane, "Existing Words", JOptionPane.PLAIN_MESSAGE); } private void deleteWord(String word) { if (word == null || word.equals("")){ JOptionPane.showMessageDialog(this, "You must enter a word to be deleted!"); return; } boolean success

WordList.java (3 K) Download Preview
@Override public String toString() { String result = ""; WordMeaningNode current = list; while (current != null) { switch(mode){ case 0: result += current.word + " \n"; break; case 1: try{ result += current.word.getWord() +

WordMeaning.java (1 K) Download Preview
java.util.ListIterator; /** * * @authorname */ public class WordMeaning { private String word; private ArrayList<String> meanings; public WordMeaning(String word, String meaning){ meanings = new ArrayList<>(); this.word = word;

WordMeaningNode.java (1 K) Download Preview
} public WordMeaningNode(WordMeaning word, WordMeaningNode next){ this.word = word; this.next = next; } public boolean hasNext(){ return next == null;

Existing words.png (156 K) Download Preview

addingword (2).png (169 K) Download Preview

Delting Word.png (169 K) Download Preview

Screenshots
Screenshot
Screenshot
Screenshot
Purchase Answer

cop3xxxAssgn5

sudheer488
sudheer488 



Find the code in the zip file.
Output screenshots are pasted in attached doc file
Attachments
dictionary.rar (2 K) Download
Preview
case 2: word = GetData.getString("Enter the obsolete word:") .toUpperCase(); try { al=diction.remove(word); WordMeaningNode list; for(int i=0;i<al.size();i++){ list=(WordMeaningNode) al.get(i); entry = new WordMeaning(list.getWordMeaning().getName(), list.getWordMeaning().getDefinition()); diction.add(entry); } obsolete.add(new WordMeaning(word, " ")); JOptionPane.showMessageDialog(null, word + "has

Preview
class GetData { static double getDouble(String s) { return Double.parseDouble(getString(s));

Preview
result = ""; int count = 0; WordMeaningNode current = list; WordMeaningNode rcurrent=null; while (current != null) { count++; result += current.getWordMeaning().getName() + "\n" + "\t" + current.getWordMeaning().getDefinition()+"\n"; current = current.next; } return result + "\nThe

Preview
getName() { return name; } String getDefinition() { return definition;}

Preview
WordMeaningNode(WordMeaning w) { wordMeaning = w; next = null;

Doc1.docx (2895 K) Download
Screenshots
Purchase Answer