import java.io.*; import java.util.*; public class OrdersHtml { public static void main(String[] args) throws IOException{ File output = new File("output.html"); //create a new file for output. output.createNewFile(); //create a new file if necessary. BufferedWriter out = new BufferedWriter(new FileWriter(output)); String fname = "Details.csv"; StringTokenizer st; int total = 1, qty = 0; double price_unit = 0., sum = 0.; BufferedReader in = new BufferedReader(new FileReader(fname)); out.write("
| " + st2 + " | "); //write the product's name to the output file. } if(total%5 == 3){ //Assume that there are 5 fields in this data file. Print the 3rd field price_unit = Double.parseDouble(st2); out.write("$" + st2 + " | "); //write the per unit price to the output file. } if(total%5 == 4){ //Assume that there are 5 fields in this data file. Print the 4th field qty = Integer.parseInt(st2); sum = price_unit*qty; sum = (double) Math.round(sum*100)/100; out.write("" + qty + " | $" + sum + " |