Your software will then display a menu of tasks it can perform
Ask Expert

Be Prepared For The Toughest Questions

Practice Problems

Your software will then display a menu of tasks it can perform

Assignment 1

Write a program that when executed will parse the dictionary file, dictionary2022_S0.txt, provided with this assignment. It will load the information for each word (name, type and definition) from the file into a new instance of a Word class and add this instance to a list of Word objects contained in an instance of a Dictionary class. Your software will then display a menu of tasks it can perform. The program will then prompt the user to enter a number corresponding to one of the following menu items:

Basic Tasks

1. Prompt the user to enter a word. If that exact word is in the dictionary, print the word’s name, followed directly on the same line by the word type using the scheme in Table 1, and the word’s definition.

If the word is not in the dictionary print ‘word not found.’

Table 1: Print the word type using this scheme.


2. Find the word(s) that contain a given character more than a given number of times. The character and minimum number of times it has to occur should be obtained from the user.

Eg : Users wants to finds all the words that has double “o” , so he inputs the letter “O” and the no.of times as “2”

3. List the words that have a 'q' without a following 'u' eg 'Iraqi'

Once a task has been executed, the program should return to the main menu, allowing the user to specify another task.

Classes to Create (for Part 1)

This is to help you get started with your dictionary. Words in italics indicate what you MUST call your classes, methods or fields if you wish to receive marks for your effort. Each class should be implemented in its own file.

Create a 'Word' class 

Fields: 

o name (string) The word in the dictionary

o type (string)

o definition (string) 

Methods: 

o Getters for word, definition and type

o printDefinition – print the word’s definition to the console in accordance with the requirement for basic task 1.

Create a ‘Dictionary_Part01’ class which 

maintains an appropriate STL container of Word objects 

loads the dictionary file into its array of Word objects using a loadDictionary method.

Performs the tasks needed for this assignment – with a separate method for each task.

Appendix 1 at the end of this document outlines the structure of the dictionary file.

Appendix 1: Format of the dictionary file:

Notes about dictionary.txt 

Text format (ascii) 

3 lines per definition 

o Line 1: Word type

o Line 2: Word name

o Line 3: Word definition - The definition(s) (all as one line)  

o Separator line, containing “**”, not part of the actual word.

Word 

o Only uses characters a-z and the hyphen ‘-‘ 

o No words are presented with spaces, the words are joined OR a hyphen is used. e.g. “bumble bee” is “bumblebee” 

o ALL words are in lower case, even proper nouns. 

Type, a single word (see table 1) 

Definition 

o Multiple definitions of the same word separated by semicolon followed by two spaces (semicolon followed by one space is just a semicolon). 

•The definitions were not written by your lecturer or ECU. We take no responsibility for any inaccuracies or the content. 

o The definitions are from the GCIDE project, made available under the terms of the GNU general Public License, GCIDE_XML is necessarily also published under those terms. See the file gpl.txt or <http://www.gnu.org/copyleft/gpl.txt>. 

Table 2 Types present in the dictionary and the key Words used to denote them.


Hint
ComputerMicrosoft Office is a family of server software, client software, and the services that were developed by Microsoft. Both MS Word and MS Excel are the part of the Microsoft Office suite and is different from each other when it comes to their uses and functioning. Also, MS Word is a processing software used for writing the essays, letters, notes, etc. And, MS Excel is a spreadsheet software...

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.