Question: Question : Dictionary ImplementationIn this project, we will implement a simple dictionary of English - Turkish with orderedelements. This will be done via two arrays:
Question : Dictionary ImplementationIn this project, we will implement a simple dictionary of EnglishTurkish with orderedelements. This will be done via two arrays: one array with a struct elements storing twostrings, English and Turkish words, and another array storing the index of the next elementfor a given entry. This is shown in Fig. I when we have words entered by a user. Notethat we keep two integers in addition to two arrays: one for the size of the elements in thearray, and another one for the starting index of the array.Adding an Element:Startndes :Siae ;Array Index The Dictionary EntriesDeleting an Element:ColdSoukSyah, KaraFigure l: Entries after the addition of words pairs,WhiteBeyaz,Startindex ;In Fig. the entries are added one by one, As an example, in Fig. we show the casewhere we add a new element. The new element is added to the end of the array, the sizeis increa sed by l and then we update array that stores the indices of the elements., Forexample, if we now add Dry Kuru pair, we add this to the end of the array, and we thenincrease the size from to Since the Next Element array is needed for sorted values, weknow that Dry will come after Cold word. We then change the next element for Cold Indexfrom to Since after Dry word, Hot word comes, we change the Next elenent at index to or just copy the next element of Cold for Dry, indicating the next word after Dry atindex is Hot at index The rest stays as is Note that if the newly added word was Athen this would have been the first word and in addition to the procedure above, we wouhave to change the StartIndex to Array Index The Dictionary EntriesStartincax Size;utumrSoguionbahasinh arssprinaWhiteStartindex :Figure : Entries when we add the pair Dry KuruSonbahaIn Fig. we show the case where we delete an element. Here, we want to remove AntumnGuz,Sonbahar pair. Here, we decrease the size from to Then, we want to replacethe entry for Autumn with the last entry in the array at index since we want to add thenext elenent starting from the bottom of the array. When we rernove Autumn, we know thatthe next element after Autumn is Black, and Autumn is the first elerment. Since Autumnis removed, the Starting Index now should now be the Next Element of Autumn, or Black,or StartIndex Thus, we also change the StartingIndex. We make the other changes asshown in Fig. The final status of the arrays is shown in Fig. As you can notice, we canremove the data from the last index after it is moved.CoT Dtonary EntrlesG Sonbahar KuruBlackSpriBahaDryNext ElerSrakArray inde The Dietionary EntriesNext ElementSiyah, KarawhiteBeyaz,.Figure : Entries when deleting the AutumnGuz,Sonbahar pairNext ElementNet ElementFigure : Entries after the AutumnGuz,Sonbahar pair is deleted.
In addition to the above procedure, your project should have the following functionalities:
The array element storing the words must be an array of a struct, where in the struct
you will have two character arravs to store EnglishTurkish words. You can set the
character array size to
The dictionary should have a size of at most. If there are elements already in the array and a user needs to add more elements, you should issue a message saying that the dictionary is full and hence no addition can be made. Similarly if a user needs to delete an element, issue an error if the element is not in the array or if the array is empty. To delete an element a user needs to enter an English word, not Turkish.
Make sure capitalization does not play a role. Thus, Autumn and autumn should be treated the same.
You should have a user screen menu with options telling a user: To add an entry, delete an entry, Print the entries in order, To Quit.
To add an entry, ask the user English word first, then the meaning in Turkish.
To delete an entry ask the user to enter an English word only.
The array printing should look nice. We leave this to you but make sure they are ordered according to the English words.
Make other necessary assumptions.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
