It's Solved!
public static void displayResult() throws IOException{
double cost = composeReport();
try{
FileWriter fw = new FileWriter("dailyreport.txt", true);
PrintWriter out = new PrintWriter(fw);
String output = ("Customer " + report + " for "+ df.format(cost) + " dollars.\n");
if(buy){
JOptionPane.showMessageDialog(null, "You receive: \n"
+ df.format(cost) + " dollars\n"
+ "We appreciate your business!");
}else{
JOptionPane.showMessageDialog(null, "Your charge for the transaction is:\n"
+ df.format(cost) + " dollars\n"
+ "We appreciate your business!");
}
out.append(output);
out.close();
}catch(Exception e){
e.printStackTrace();
System.err.println("Error: " + e.getMessage());
}
}
I had to add this if statement to get it to give the proper output dialog box for the user. Thanks so much for all the help NormR1!