can someone do this?

profileAlex cary
Q1.docx

1. Program Analysis to Program Design, 10 points

-Your analysis of the provided information and the provided sample output.

A) After analyzing the provided information, I start to think about the appropriate data structure according to me which could function properly like a dictionary with search functions. It was pretty clear from the instructions that each keyword, part of speech and definition must be stored in separate data fields so I created 12 different variables which would store the definition of the keyword with respect to the appropriate part of speech.

-What problem you are solving?

A) The problem that I am solving is to find a data structure that can act like an ordinary dictionary. Loading a set of pre-defined words along with their meanings to make sure that the user can easily fetch the meaning of any word that they want. Providing the user with certain search functions would help them accomplish this task.

-How you store data in ‘Enum objects’ and why?

A) Since a single keyword could belong to more than one part of speech and more than one definition, so I created 12 string variables for each ‘enum’ object. These string variables represented the different parts of speech and I stored the appropriate definition in the correct variables. Like for example, I stored the adjective definition in the object’s adjective variable and I stored the noun definition in the object’s noun variable. Each ‘enum’ object had 2 adjective variables, 3 noun variables, 2 verb variables and the rest of the parts of speech had one each. The constructor took all the 12 parts of speech as string type parameters and stored the data in the respective variables. So, during the creation of the objects, I passed the arguments which were available and passed the remaining non-available arguments as empty strings.

The reason for using ‘enum’ is that the data was pre-defined and had to remain constant or unchangeable. As we know that the definition of each word in the dictionary is mostly never changed or altered and remains the same.

-Which data structure(s) you use/create for your dictionary. And why.

A) I used the array list data structure because it is very simple and easy to use. Another reason was that it would automatically increase in size when the dictionary would run out of memory space. Therefore, there was no worry of memory space being limited. Also, the array list is a built in data structure in Java so all I needed was to import and use it.