public static void cCommand(Scanner in) throws FileNotFoundException {
System.out.println();
System.out.print("Type an output file name: ");
String outFile = in.nextLine();
PrintStream ps = new PrintStream(new File("out.txt"));
Scanner input = new Scanner(new File("story.txt"));
while (input.hasNextLine()) {
String line = input.nextLine();
Scanner console = new Scanner(line);
while (input.hasNext()) {
String word = console.next();
if (word.startsWith("<") && word.endsWith(">")) {
char first = word.charAt(1);
String a = aeiou(first);
word = word.replace("<"," ");
word = word.replace(">"," ");
word = word.replace("-"," ");
System.out.print("Please type" + a + word + ": ");
String replace = in.next();
ps.print(" " + replace);
} else {
ps.print(" " + word);
}
}
}
} //end of cCommand method
this error pops up:
Type an output file name: Exception in thread "main" java.util.NoSuchElementException