Since you do not specify what is not working it is difficult to help. However, if you want to use the filenames that the user has provided as input you must start with removing the quotation marks around the variables names:
inputStream = new FileReader(inputfile);
outputStream = new FileWriter(outputfile);
Then you of course must add code for the n=1 case.