, for the initial version of the dictionary we provided with the assignment, if a user...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
, for the initial version of the dictionary we provided with the assignment, if a user enters the word: "my", your program should report that a phrase starting with the word: "my" was not found. In all cases, after reporting the results of a Search, your program should prompt the user for the next command. Delete word or phrase: After obtaining the word or phrase from the user, Delete word or phrase should behave as follows: After obtaining the word or phrase the user is trying to delete, your program should behave similarly to lookup, as follows: i. ii. iii. If there is an exact match, your program should remove the word or phrase and its definition, and report that the word or phrase was successfully removed from the dictionary to the user. Otherwise if there is more than one partial case-insensitive match for the word or phrase the user is trying to remove, your program should report that there was more than one possible candidate for removal, and print out all the words or phrases matching some or all of the search word or phrase and their respective definitions. Note, your program should not remove any of the partial matches, and ask the user to try again. Finally, if there is no case-insensitive match or partial match, your program should report that no match was found. After reporting the results of cases i, ii, or ii above, your program should prompt the user for their next command. Add a new word or phrase. After obtaining the word or phrase and new definition from the user, your program should check to see if an exact case-insensitive match for the new word or phrase already exists in the dictionary. If there is, your program should report that the word or phrase already exists to the user and prompt them for their next command. Otherwise, your program should create a new DictionaryEntry with the new word or phrase, add it to the dictionary, report success to the user, and prompt them for their next command. Note, it is required that your program maintains the dictionary in lexically ascending order (that is, from A to Z)! Therefore, you should ensure a new word or phrase is inserted in a way that maintains lexically ascending order in the dictionary, or sort the dictionary into lexically ascending order after adding a new word or phrase and its definition to the dictionary. Update the definition for a word or phrase. After obtaining the word or phrase and new definition from the user, your program should find the exact match for the word or phrase in the dictionary and then replace the existing definition with the new definition, report success and then prompt the user for their next command. If an exact (case insensitive) match for the does not exist, then your program should report that and prompt the user for the next command. Close the dictionary. When a user selects this command, your program should: I. Prompt the user for the name of an output file, and after obtaining the name of the output file and successfully opening it, II. III. write the current contents of the dictionary (sorted in lexically ascending order, A->Z) out to the file and then, print a message to the user indicating the dictionary has been closed, and exit from the program. Note, each time your program runs, it should be able to use the version of the dictionary that was saved the last time you ran the program. Therefore, when developing your program, you may want to make a backup copy of the dictionary files that successfully store your dictionary. 1.2 Designing your Dictionary of Slang You are required to create UML class diagrams (that is a class designs) of your program. Your diagram should include all the classes you create as well as the Java classes you use in your program. Your diagram should also contain the relationships between the classes (inheritance, realization, arrows denoting one or more associations, composition associations, and/or aggregation associations, etc.) between classes. Note, before doing any implementation (coding), you are required to create a UML class diagram to help you formulate an idea of how the data required by your program should be represented so the required operations specified above can be carried out by your program. After you complete your program, you will make a copy of your initial UML diagram and update it to match your implementation. You are required to turn in both your initial and final versions of your UML diagrams. 1.3 Implementing your Slang Dictionary The control architecture of this program is relatively straightforward: I. Get Input (Configure the Dictionary - read file slangdictionary.txt and populate the dictionary) , for the initial version of the dictionary we provided with the assignment, if a user enters the word: "my", your program should report that a phrase starting with the word: "my" was not found. In all cases, after reporting the results of a Search, your program should prompt the user for the next command. Delete word or phrase: After obtaining the word or phrase from the user, Delete word or phrase should behave as follows: After obtaining the word or phrase the user is trying to delete, your program should behave similarly to lookup, as follows: i. ii. iii. If there is an exact match, your program should remove the word or phrase and its definition, and report that the word or phrase was successfully removed from the dictionary to the user. Otherwise if there is more than one partial case-insensitive match for the word or phrase the user is trying to remove, your program should report that there was more than one possible candidate for removal, and print out all the words or phrases matching some or all of the search word or phrase and their respective definitions. Note, your program should not remove any of the partial matches, and ask the user to try again. Finally, if there is no case-insensitive match or partial match, your program should report that no match was found. After reporting the results of cases i, ii, or ii above, your program should prompt the user for their next command. Add a new word or phrase. After obtaining the word or phrase and new definition from the user, your program should check to see if an exact case-insensitive match for the new word or phrase already exists in the dictionary. If there is, your program should report that the word or phrase already exists to the user and prompt them for their next command. Otherwise, your program should create a new DictionaryEntry with the new word or phrase, add it to the dictionary, report success to the user, and prompt them for their next command. Note, it is required that your program maintains the dictionary in lexically ascending order (that is, from A to Z)! Therefore, you should ensure a new word or phrase is inserted in a way that maintains lexically ascending order in the dictionary, or sort the dictionary into lexically ascending order after adding a new word or phrase and its definition to the dictionary. Update the definition for a word or phrase. After obtaining the word or phrase and new definition from the user, your program should find the exact match for the word or phrase in the dictionary and then replace the existing definition with the new definition, report success and then prompt the user for their next command. If an exact (case insensitive) match for the does not exist, then your program should report that and prompt the user for the next command. Close the dictionary. When a user selects this command, your program should: I. Prompt the user for the name of an output file, and after obtaining the name of the output file and successfully opening it, II. III. write the current contents of the dictionary (sorted in lexically ascending order, A->Z) out to the file and then, print a message to the user indicating the dictionary has been closed, and exit from the program. Note, each time your program runs, it should be able to use the version of the dictionary that was saved the last time you ran the program. Therefore, when developing your program, you may want to make a backup copy of the dictionary files that successfully store your dictionary. 1.2 Designing your Dictionary of Slang You are required to create UML class diagrams (that is a class designs) of your program. Your diagram should include all the classes you create as well as the Java classes you use in your program. Your diagram should also contain the relationships between the classes (inheritance, realization, arrows denoting one or more associations, composition associations, and/or aggregation associations, etc.) between classes. Note, before doing any implementation (coding), you are required to create a UML class diagram to help you formulate an idea of how the data required by your program should be represented so the required operations specified above can be carried out by your program. After you complete your program, you will make a copy of your initial UML diagram and update it to match your implementation. You are required to turn in both your initial and final versions of your UML diagrams. 1.3 Implementing your Slang Dictionary The control architecture of this program is relatively straightforward: I. Get Input (Configure the Dictionary - read file slangdictionary.txt and populate the dictionary)
Expert Answer:
Related Book For
Accounting Principles
ISBN: 978-1119419617
IFRS global edition
Authors: Paul D Kimmel, Donald E Kieso Jerry J Weygandt
Posted Date:
Students also viewed these accounting questions
-
This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of an array of objects as a class data...
-
a. Find the nth-order Taylor polynomials for the given function centered at the given point a, for n = 0, 1, and 2.b. Graph the Taylor polynomials and the function. f(x)=x, a = 9
-
Who uses tests of controls?
-
A particle carrying a charge of \(+32.0 \mathrm{nC}\) is located at \((10.0 \mathrm{~nm}, 95. 0 \mathrm{~nm})\), and a particle carrying a charge of \(+98.0 \mathrm{nC}\) is located at \((45.0...
-
How is net sales computed?
-
During July 2010, Tricoci, Inc., sold 250 units of its product Empire for $4,000. The following units were available. A sale of 250 units was made after purchase 3. Of the units sold, 100 came from...
-
Has the Medical-Surgical team applied the Lead User research process successfully? Why or why not?
-
The key question answered by incremental analysis is: a. Does the lowest cost alternative have an IRR > MARR? b. Is the IRR earned on the additional cost > MARR? c. Which alternative has the highest...
-
The mass of a pendulum bob of a cuckoo clock is \(30 \mathrm{~g}\). How far from the pin support should the bob be placed such that its period is \(1.0 \mathrm{~s}\) ?
-
Brightland Tech manufactures computer control boards for other manufac- turers of consumer goods such as microwave ovens, toys, and flat screen monitors. Brightland's product is intended for finished...
-
A \(250 \mathrm{~kg}\) compressor is to be placed at the end of a \(2.5-\mathrm{m}\) fixed-free steel \(\left(E=200 \times 10^{9} \mathrm{~N} / \mathrm{m}^{2} ight)\) beam. Specify the allowable...
-
The initial recoil velocity of a \(1.4-\mathrm{kg}\) gun is \(2.5 \mathrm{~m} / \mathrm{s}\). Design a recoil mechanism that is critically damped such that the mechanism returns to within \(0.5...
-
A recoil mechanism of a gun is designed as a spring and viscous damper in parallel such that the system has critical damping. A \(52-\mathrm{kg}\) cannon has a maximum recoil of \(50 \mathrm{~cm}\)...
-
Describe a job you have had in the past or a job you are very familiar with. Indicate the negative aspects of the job and how it could be improved with current human resource management techniques.
Study smarter with the SolutionInn App