Given the UML class diagram of a program
named SpellChecker. Assume that the
classes Dictionary and Word and the
method main have been implemented. Below are the design
specifications of the class SpellChecker
a, Briefly discuss an alternative design of
class SpellChecker that does not include the
operation getSpellErrors but still provides the same
output to the calling program.
b,
Word can be replaced by the Java's String class:
Select one:
a. True.
b. False.
c,
SpellChecker depends on Dictionary because:
Select one:
a. Its main method takes a Dictionary object as input.
b. It needs to invoke a Dictionary's method.
c. It includes Dictionary as part of its design.
d. It references the attribute Dictionary.entries.
d,
Which of the following dependencies in the diagram can be
replaced by a weak dependency:
Select one:
a. association (Dictionary, Word).
b. association (SpellChecker, Dictionary).
c. association (SpellChecker, Word).
Spellchecker - dict: Dictionary - spellErrors: List<Word> + Spellchecker(dict: Dictionary) + checkSpell(doc: String) + getSpellErrors(): List<Word> + <static> main(String]) Word - label: String Dictionary - entries: Map<Word, List<Word>> + Dictionaryo + addEntry( Word, List<Word>) + lookUp(Word): boolean + Word(label: String) + getLabel(): String + toString(): String
Given the UML class diagram of a program named SpellChecker. Assume that the classes Dictionary and Word and the method
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am