Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USING JAVA Part2 (7.5 Points): English Dictionary: Write a program that reads an English word from the user and prints the possible translations of the

image text in transcribed

image text in transcribed

USING JAVA

Part2 (7.5 Points): English Dictionary: Write a program that reads an English word from the user and prints the possible translations of the entered word in a different language of your choice. The English word may have more than one meaning. So, your program should handle this case properly. The program is expected to allow the user to add new words to the dictionary. That is, if the user chooses to add a new word, the program reads the English word from the user and then prompts the user to insert a line of the possible translates of the English word. You can assume that the program supports only one language. Possible example runs are shown below: Welcome to my English-Arabic dictionary 1: Translate a word. 2: Add a new word to the dictionary 3: Remove a word 4: Print all stored words and translations. 0: Exit Enter 0-4 please: Please enter your word: ball Translation: pallone, palla 1: Translate a word. 2: Add a new word to the dictionary 3: Remove a word 4: Print all stored words and translations. 0: Exit Enter 0-4 please: Please enter your word: neighbor Translation: **No Translation! ** 1: Translate a word. 2: Add a new word to the dictionary 3: Remove a word 4: Print all stored words and translations. 0: Exit Enter 0-4 please: Please enter your new word: neighbor Please enter the translations on the same line spile by , if more than one meaning: prossimo, adjacent 1: Translate a word. 2: Add a new word to the dictionary 3: Remove a word 4: Print all stored words and translations. @: Exit Enter 0-4 please: Please enter your word: neighbor Translation: prossimo, adjacent 1: Translate a word. 2: Add a new word to the dictionary 3: Remove a word 4: Print all stored words and translations. : Exit Enter 0-4 please: Invalid Entry! (0,4] 1: Translate a word. 2: Add a new word to the dictionary 3: Remove a word 4: Print all stored words and translations. 0: Exit Enter 0-4 please: Good Bye! Tips: Create a text file to store your words and translations such that each work has a record of two lines, the word, and the translation. That is, I would store the word on a line and all the synonym on the line that follows. If there are many synonyms, then separate them with a comma. I would read the words in an array (String array) and the translations in a different array (parallel arrays). All the operations are done on the array and once the user chooses to exit the program, the file is overwritten by the new data stored in the arrays. Try to have a level of modularity in your program. Static Notes: o Please take your time to the analysis and design phases. Then, implement your programs in an incremental way the way I explained in class. o Forgetting to submit the work is not a professional excuse. Please avoid this approach. A better strategy is to start working as soon as possible and plan to show your work to the TA and me before the deadline for some recommendations and advice. Part2 (7.5 Points): English Dictionary: Write a program that reads an English word from the user and prints the possible translations of the entered word in a different language of your choice. The English word may have more than one meaning. So, your program should handle this case properly. The program is expected to allow the user to add new words to the dictionary. That is, if the user chooses to add a new word, the program reads the English word from the user and then prompts the user to insert a line of the possible translates of the English word. You can assume that the program supports only one language. Possible example runs are shown below: Welcome to my English-Arabic dictionary 1: Translate a word. 2: Add a new word to the dictionary 3: Remove a word 4: Print all stored words and translations. 0: Exit Enter 0-4 please: Please enter your word: ball Translation: pallone, palla 1: Translate a word. 2: Add a new word to the dictionary 3: Remove a word 4: Print all stored words and translations. 0: Exit Enter 0-4 please: Please enter your word: neighbor Translation: **No Translation! ** 1: Translate a word. 2: Add a new word to the dictionary 3: Remove a word 4: Print all stored words and translations. 0: Exit Enter 0-4 please: Please enter your new word: neighbor Please enter the translations on the same line spile by , if more than one meaning: prossimo, adjacent 1: Translate a word. 2: Add a new word to the dictionary 3: Remove a word 4: Print all stored words and translations. @: Exit Enter 0-4 please: Please enter your word: neighbor Translation: prossimo, adjacent 1: Translate a word. 2: Add a new word to the dictionary 3: Remove a word 4: Print all stored words and translations. : Exit Enter 0-4 please: Invalid Entry! (0,4] 1: Translate a word. 2: Add a new word to the dictionary 3: Remove a word 4: Print all stored words and translations. 0: Exit Enter 0-4 please: Good Bye! Tips: Create a text file to store your words and translations such that each work has a record of two lines, the word, and the translation. That is, I would store the word on a line and all the synonym on the line that follows. If there are many synonyms, then separate them with a comma. I would read the words in an array (String array) and the translations in a different array (parallel arrays). All the operations are done on the array and once the user chooses to exit the program, the file is overwritten by the new data stored in the arrays. Try to have a level of modularity in your program. Static Notes: o Please take your time to the analysis and design phases. Then, implement your programs in an incremental way the way I explained in class. o Forgetting to submit the work is not a professional excuse. Please avoid this approach. A better strategy is to start working as soon as possible and plan to show your work to the TA and me before the deadline for some recommendations and advice

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional IPhone And IPad Database Application Programming

Authors: Patrick Alessi

1st Edition

0470636173, 978-0470636176

Students also viewed these Databases questions

Question

What lessons in intervention design, does this case represent?

Answered: 1 week ago