Hey everyone,
I have an assignment to make and I need help with it so I'm putting here what I need for you to understand.
Basically I need a C program for a double linked list.
The user will input a string that handles (word)_#_(year)_#_(definition)_#_(SYNONYM)
ex: invest_#_2009_#_trade_#_EXCHANGE
Now the user can input a string like this below.
ex: desert_#_2002,_2008,_2003_#_wasteland,_wilderness_#_DESERT,_SAHARA
so first of all what I'll need is to split the string into char word which contains the word, int year, char definition and char synonyms.
No i have a few conditions for that string which are right below:
- Word has to be in lower case letters
- Year has to be a positive number
- Definition has to be in lower-case letters
- Synonyms has to be in UPPER-CASE letters
So if these conditions are there then i need to print "Not legal" and continue with my linked list
Now for my linked list:
I have to build a linked list that stores the string and the word of course and basically I need my linked list to have the following options:
- Adds a new word to the dictionary (including everything)
- Deletes a word in the dictionary (like: what word do you want to delete? user inputs the word and it deletes the whole string)
- Sort the words in alphabetical order
- Prints all the words only (not with their definition etc...)
- Searches for the word
- Searches for the year and gives all the words the year relates to
- Searches for the definition and gives all the words the definition relates to
- An option that prints all the definition pairs (look above)
so if let's say I have inputted the following words:
devoted_#_2003,_2001,_2008_#_worship_#_AHAVA
desert_#_2002,_2008,_2003_#_wasteland,_wilderness_#_DESERT,_MIDBAR
love_#_2001,_2008_#_adore,_worship_#_AHAVA
test_#_1999,_1907_#_exam,_check_#_TRIAL,_INVESTIGATION,_DESERT
You'll see that devoted and love have the same definition.
*Please make sure that all words have to be in alphabetical order at all times.