1. Basic Digital Dictionary
Course: EEE105
Course name: Computer programming
Sec: 1
Semester: Spring 2022
Group No.: 02
Members
Abdullah Al Hadi – 2018-1-80-060
Sonjoy Chandra Mohonto – 2018-1-80-065
Debabrata Roy – 2021-1-80-022
Course instructor
Nusrat Jahan Ananna
Lecturer, Dept. of EEE
2. Objective:
• To design a dictionary that will show antonym or synonym of a given word.
Basic Algorithm:
1. Take a word as input.
2. Find the word in the database using a function.
3. If the word found the function return its corresponding row other wise
display “word not found” and go to step 6.
4. With another function and by user choice find the antonym or synonym
according to the row.
5. Display the antonym or synonym.
6. Take choices from user if he/she want to continue or end the program
7. If want to continue go to step 1 other wise exit the program.
3. Database:
Declared a universal database of 102 words with a char pointer.
The words arranged like: {“Main word ”, ” Synonym ”, ” Antonym ”} within a 102*3 matrix.
Word 1 Synonym 1 Antonym 1
Word 2 Synonym 2 Antonym 2
Word 3 Synonym 3 Antonym 3
……
Word 102
……
Synonym 102
……
Antonym 102
Data[0][0] Data[0][1] Data[0][2]
Data[1][0] Data[1][1] Data[1][2]
Data[2][0] Data[2][1] Data[2][2]
……
Data[101][0]
……
Data[102][2]
……
Data[102][2]
Data[0][0] Data[0][1] Data[0][2] Data[1][0] Data[1][2] Data[1][3] …….... Data[101][0] Data[101][1] Data[101][2]
Originally,
4. Basic Flowchart (Main):
• Findword (word): A function that takes the
word as input and return its corresponding
value of row.
• Ant_or_syn(row): A function that takes the row
value as input and display the antonym of
synonym.
2nd column of that row = Synonym
3rd column of that row = Antonym
• System_clear(): A function that let user decide
whether the user wants to continue or end.
5. Basic Flowchart, Findword():
• Strcmp (database[ i ][0], word): Compare the word with
the all element (102) of 0 column and if matched it will
return 0.
Requires string.h library function.
• I =102 means word not found as total 102 word so i= 0 to
101.
• If word found, break the loop and the iteration will be the
value of row.
• Return row: The value of row will be returned to
corresponding variable of main function.
6. Basic Flowchart,
Ant_or_syn():
• Strcmp(as, ant): Compare given word,
if that is antonym or not.
• Strcmp(as, syn): Compare given
word, if that is synonym or not.
• If doesn’t match anyone will start this
fuction from intial.
7. Basic Flowchart, system_clear():
• If user gives input -1 it will call system(“cls”).
• System(“cls”): A function that sends the cls command
to Windows command prompt directly. And in
response to the cls command, the Windows
command prompt clears the output screen of the
program.
Works for windows os only.
Requires stdlib.h library function.
• Exit(0): A function that end the entire
program.
Reports the successful termination/
completion of the program.
Requires stdlib.h library function.