Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

find highest values from a file

$
0
0
This program is a sales application that saves sales information to a .txt textfile, I want to know how to find the highest sales figure from the text file

method to write to file

		try{
		
			FileWriter fw = new FileWriter(salesfile,true);
			BufferedWriter bw = new BufferedWriter(fw);
			fw.write("	Product: "+itemname+"\t");
			fw.write("\t\t");
			fw.write("ItemCode: "+itemcode+"\t");
			fw.write("\t\t");
			fw.write("Unitcost: " +sunitcost+"\t");
			fw.write("\t\t\t");
			fw.write("Quantity: " +squantity+"\t");
			fw.write("\t\t");
			fw.write("Date of Purchase:" +dateNow);

			fw.write("\n");
			fw.write("\n");
			bw.close();
			fw.close();
			
		}catch(IOException ioe){
			System.out.println(ioe);
		}




Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>