Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

public static String updateFileName(Scanner sc, String curFileName) { //FIXME return ; } /** * Opens and reads the contents of the dictionary file specified in

public static String updateFileName(Scanner sc, String curFileName) {

//FIXME

return "";

}

/**

* Opens and reads the contents of the dictionary file specified in fileName. The file is

* assumed to be a text file encoded in UTF-8. It is assumed that there is one translation

* mapping per line. Each line contains a key and its translation separated by a tab.

* Note: The dictionary file is assumed to be sorted by the keys in ascending order.

*

* For each line in the dictionary file, an entry is added into wordList. The entry is a String

* array of length 2, where the value of index 0 is the key and the value of index 1 is the

* translation.

*

* When opening the file, any FileNotFoundException is caught and the error message

* "Exception: File 'fileName' not found." followed by a new line is output,

* where fileName is the name of the file that the method attempted to open.

*

* @param fileName

* @param wordList Reference to ArrayList to contain the translation mappings.

* @throws IOException if an I/O error occurs when closing the file. FileNotFoundException is

* caught when opening the file.

*/

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

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions

Question

1. Clarify your objectives.

Answered: 1 week ago

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago