Hello":)
I have code and I wont your help in telling its right or wrong and what missing....
This is the question ::
If the user chooses 1, then the program asks the user: “Please enter a new dictionary file name”. The program creates a new file with this file name, then it asks the user: “Please enter a word and its meaning separated by a comma”. After the user enters the word and its meaning, the program asks the user “would you like to enter another word?” if the answer is yes, then the user is asked to enter another word. If the answer is no, the file is saved to disk and the user is presented with the original menu.
the code::
public class Dictionary {
private static void Dictionary() {
File file = new File("dictionary.txt");
boolean success = false;
try {
// Create file on disk (if it doesn't exist)
success = file.createNewFile();
} catch (IOException e) {
}
if (success) {
System.out.println("File did not exist and was created.\n");
} else {
System.out.println("File already exists.\n");
}
}
I have this Question also;;;;
The chooses when the user select 1,2,3 I do it in the main class yes or no??
Here in this "if the answer is yes, then the user is asked to enter another word.." it means using if statment yes or no??
Thank you....