For words with multiple definitions, each definition should be separated with a line
Ask Expert

Be Prepared For The Toughest Questions

Practice Problems

For words with multiple definitions, each definition should be separated with a line

Assignment 2

An extension of Assignment 1. Create a class Dictionary_Part02, which inherits from Dictionary_Part01. In Dictinoary_Part02, implement these additional tasks and add appropriate menu options for them to the menu of the program.

Basic Tasks:

1. List all words that are palindromes. e.g .”civic”

2. Prompt the user for a word, and report all words that are anagrams of the word (e.g. “admirer” and “married”)

Intermediate tasks 

3. Override the ‘findWord’ function, so that it produces ‘nicer’ output:

a. The search should not be case sensitive.

b. For words with multiple definitions, each definition should be separated with a line-break – these are represented in the file by a semicolon followed by two spaces.

c. Proper nouns should have their word name capitalised (i.e. the first letter of the word should be a capital).

4. Guessing game – present the definition of a random noun and the length of that noun and ask the user to guess that noun, giving three tries. If the user guesses right, print a congratulatory message. After the first incorrect guess, reveal the first letter of the word, after the second incorrect guess reveal the second letter, after the third guess, print a commiseratory message and print the whole word.

Advanced tasks

5. Fun with Tri-Grams

a. Using a new class, implemented in a separate file, create a class that encapsulates the following functionality: From any given text document (you can use the dictionary), calculate the probability of any character occurring after any combination of two characters (including where the first character is a space, i.e. the start of a word) and store these probabilities. Based on an input of two characters, return the three most likely characters to occur after the two characters.  Use the class to generate 10 random words which sound like English words, but do not exist in the dictionary;

Hint
Computer"Probability: It is a mathematical calculation which could be applied to a variety of several applications. So, calculating probability needs the simple formula and using the division and the multiplication to evaluate the events of possible outcomes. Formula :            P(A) = n(A) /n(S)where,P(A) = the probability of an event 'A'.n(A) = number of outco...

Know the process

Students succeed in their courses by connecting and communicating with
an expert until they receive help on their questions

1
img

Submit Question

Post project within your desired price and deadline.

2
img

Tutor Is Assigned

A quality expert with the ability to solve your project will be assigned.

3
img

Receive Help

Check order history for updates. An email as a notification will be sent.

img
Unable to find what you’re looking for?

Consult our trusted tutors.

Developed by Versioning Solutions.