Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the following program in Java: You are to write a Java program that reads an input file containing a list of words and their

Write the following program in Java:

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

You are to write a Java program that reads an input file containing a list of words and their synonyms. You will repeatedly ask the user if they want to look up the synonyms of a word, add a new synonym for a word, or quit. Here is a sample run of the program (note that the program is expecting the input file, thesaurus.txt to be in the working directory for the code.): Enter (l)ookup, (a)dd entry, or (aDuit: l Enter word: graphic Result: explicit, descriptive, pictorial, lifelike, vivid Enter (l)ookup, (a)dd entry, or (qDuit: A Enter word: graphic Enter synonym: explicit Error: cannot add entry Enter (l)ookup, (a)dd entry, or (q)uit:l Enter word: hilarious Result: uproarious Enter (l)ookup, (a)dd entry, or(q)uit: a Enter word: Hilarious Enter synonym: very funny Enter (l)ookup, (a)dd entry, or (q)uit:l Enter word: hilarious Result: uproarious, very funny Enter (l)ookup, (a)dd entry, or (q)uit:l Enter word: miniscule Result: miniscule not found Enter (l)ookup, (a)dd entry, or(q)uit: a Enter word: miniscule Enter synonym: very small Enter (l)ookup, (a)dd entry, or(q)uit: IL Enter word: miniscule Result: very small Enter (l)ookup, (a)dd entry, or(q)uit: q You are to write a Java program that reads an input file containing a list of words and their synonyms. You will repeatedly ask the user if they want to look up the synonyms of a word, add a new synonym for a word, or quit. Here is a sample run of the program (note that the program is expecting the input file, thesaurus.txt to be in the working directory for the code.): Enter (l)ookup, (a)dd entry, or (aDuit: l Enter word: graphic Result: explicit, descriptive, pictorial, lifelike, vivid Enter (l)ookup, (a)dd entry, or (qDuit: A Enter word: graphic Enter synonym: explicit Error: cannot add entry Enter (l)ookup, (a)dd entry, or (q)uit:l Enter word: hilarious Result: uproarious Enter (l)ookup, (a)dd entry, or(q)uit: a Enter word: Hilarious Enter synonym: very funny Enter (l)ookup, (a)dd entry, or (q)uit:l Enter word: hilarious Result: uproarious, very funny Enter (l)ookup, (a)dd entry, or (q)uit:l Enter word: miniscule Result: miniscule not found Enter (l)ookup, (a)dd entry, or(q)uit: a Enter word: miniscule Enter synonym: very small Enter (l)ookup, (a)dd entry, or(q)uit: IL Enter word: miniscule Result: very small Enter (l)ookup, (a)dd entry, or(q)uit

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

Databases And Information Systems 1 International Baltic Conference Dbandis 2020 Tallinn Estonia June 19 2020 Proceedings

Authors: Tarmo Robal ,Hele-Mai Haav ,Jaan Penjam ,Raimundas Matulevicius

1st Edition

303057671X, 978-3030576714

More Books

Students also viewed these Databases questions