السلام عليكم
لو سمحتو اخواني انا عضوة جديدة فالمنتدى وعندي طلب ضروري
عندي سؤال عن السي++ وماعارفة احله
الحل مطلوب في اسرع وقت
هل ممكن حد يساعدني ؟؟
اذا في حد عنده امكانية يساعدني السؤال عن array and function in c++
هذا هو السؤال
Write a C++ program that maintains a text file named Dic_File.txt to be used for English to either French or Germen translation. The file contains a list of English, French and Germen word sets. The file is to be marinated and used to translate input sentences from source language of English to either French or German language. The source language will always be English, and the target language can either be French or Germen as per the interest of the user.
The program should be menu-driven, modular and should have the following list of functionalities:
1. Translate a sentence: The program should receive a sentence in English and translate it to either French or Germen. The translation is done by creating an equivalent sentence made of set words from the target language.
2. Remove words: Remove an existing set of words. The user will supply one word in English and all the equivalent words in French and German will be removed.
3. Add new words: Allow the user to add a new set of words to the currently existing list of words in the dictionary.
4. Search for a specific word: The program should search for a specific word to be supplied by the user and display the equivalent words for it. The supplied word should be in English.
5. Display the list of words: The program should display the complete list of words.
6. Exit: This will exit the program making sure that all data including any updates are saved back to the original file.
Your program should consist of the following minimum functions:
1. Load_dictionary: This function should open the dictionary file and load data to memory into arrays as soon as the program is loaded.
2. Sort: this function should sort the loaded data into an ascending alphabetical order based on the English words.
3. Add_Words: This functions job is to add a set of new words taken from the user and append them the dictionary file
4. Remove_Words: This function removes a set of words as per the request of the user. The user should provide the existing English word to be used to remove the whole set.
5. Search_Word: This function should allow the user to search for some English word in the dictionary. If the word exists then the set of relevant French and German words should be displayed.
6. Translate_Sentence: This function should receive an English sentence and provide the equivalent sentence in the target language.
7. Save_ dictionary: This function should be called when the user exits the program to save all the loaded (updated) data to dictionary file.
Make sure that your program takes care of error case such as trying to remove non existing words or translating with words that are not available in the dictionary, and errors accessing the dictionary file.
Sample Execution
Dictionary File has been loaded …
1) Translate a sentence to French
2) Translate a sentence to German
3) Remove a set of words from dictionary
4) Add a new set of words to dictionary
5) Search and display a set of words
6) Display all words in dictionary in alphabetical order by the English word
7) Exit
Please make a selection: 1
Please enter sentence to translate to French: MY PENCILE ON THE TABLE
French translation is: MON PENCILE SUR LA TABLE.
1) Translate a sentence to French
2) Translate a sentence to German
3) Remove a set of words from dictionary
4) Add a new set of words to dictionary
5) Search and display a set of words
6) Display all words in dictionary in alphabetical order by the English word
7) Exit
Please make a selection: 2
Please enter sentence to translate to German: MY PENCILE ON THE TABLE
German translation is: MEIN PENCILE AUF DEM TISCH.
1) Translate a sentence to French
2) Translate a sentence to German
3) Remove a set of words from dictionary
4) Add a new set of words to dictionary
5) Search and display a set of words
6) Display all words in dictionary in alphabetical order by the English word
7) Exit
Please make a selection: 2
Please enter sentence to translate to German: I AM HEADING HOME
German translation is: Sorry unable to translate due to some words are not in dictionary
1) Translate a sentence to French
2) Translate a sentence to German
3) Remove a set of words from dictionary
4) Add a new set of words to dictionary
5) Search and display a set of words
6) Display all words in dictionary in alphabetical order by the English word
7) Exit
Please make a selection: 4
Please enter English word: SON
Please enter French word: FILS
Please enter German word: SOHN
Word set has been added to dictionary
1) Translate a sentence to French
2) Translate a sentence to German
3) Remove a set of words from dictionary
4) Add a new set of words to dictionary
5) Search and display a set of words
6) Display all words in dictionary in alphabetical order by the English word
7) Exit
Please make a selection: 3
Please enter English word to search for: YES
Words are removed
1) Translate a sentence to French
2) Translate a sentence to German
3) Remove a set of words from dictionary
4) Add a new set of words to dictionary
5) Search and display a set of words
6) Display all words in dictionary in alphabetical order by the English word
7) Exit
Please make a selection: 5
Please enter English word to search for: YES
Sorry no such a word in dictionary
1) Translate a sentence to French
2) Translate a sentence to German
3) Remove a set of words from dictionary
4) Add a new set of words to dictionary
5) Search and display a set of words
6) Display all words in dictionary in alphabetical order by the English word
7) Exit
Please make a selection: 5
Please enter English word to search for: SON
The word <SON> is available in dictionary. <FILS> and <SOHN> are the French and German equivalents respectively.
1) Translate a sentence to French
2) Translate a sentence to German
3) Remove a set of words from dictionary
4) Add a new set of words to dictionary
5) Search and display a set of words
6) Display all words in dictionary in alphabetical order by the English word
7) Exit
Please make a selection: 7
Data is saved to file.
G O O D B Y E
Submission Policy
وبالنسبة للفايل هذي هي محتوياته
YES
OUI
JA
TABLE
TABLE
TISCH
THE
LA
DEM
IS
EST
IST
YELLOW
JAUNE
GELB
FRIEND
AMI
FREUND
SICK
MALADE
KRANK
MY
MON
MEIN
LARGE
GROS
GROSS
NO
NON
NEIN
HAT
CHAPEAU
HUT
PENCIL
CRAYON
BLEISTIFT
RED
ROUGE
ROT
ON
SUR
AUF
AUTO
AUTO
AUTO
OFTEN
SOUVENT
OFT

