The expected output as given in Figure 2: Postagelummeny bet - Netepad File Edt Format View Help Monthly Sunnary 1) The total weight of all iten is 22.7kg 2) The total price of all iten is 128.52 3)...



here solution for part a pls give solution for part b, c, d


import java.io.*;
public class CopyFile {


   public static void main(String args[]) throws IOException {
      FileInputStream in = null;
      FileOutputStream out = null;


      try {
         in = new FileInputStream("input.txt");
         out = new FileOutputStream("output.txt");

         int c;
         while ((c = in.read()) != -1) {
            out.write(c);
         }
      }finally {
         if (in != null) {
            in.close();
         }
         if (out != null) {
            out.close();
         }
      }
   }



The expected output as given in Figure 2:<br>Postagelummeny bet - Netepad<br>File Edt Format View Help<br>Monthly Sunnary<br>1) The total weight of all iten is 22.7kg<br>2) The total price of all iten is 128.52<br>3) The most heaviest iten details:<br>Postcode: 20000<br>Weight: 12.8kg<br>Content type: cloth<br>Postage fee: RN67.99<br>c) Close all file streams in used.<br>d) Apply exception handling mechanism in the program<br>

Extracted text: The expected output as given in Figure 2: Postagelummeny bet - Netepad File Edt Format View Help Monthly Sunnary 1) The total weight of all iten is 22.7kg 2) The total price of all iten is 128.52 3) The most heaviest iten details: Postcode: 20000 Weight: 12.8kg Content type: cloth Postage fee: RN67.99 c) Close all file streams in used. d) Apply exception handling mechanism in the program
Given the following text file named Posini.txt in Figure 1 that contains posting data of a courier company Posini. The data is comprised of postcode, weight (kg), content type and postage fee.<br>Posini.bt - Notepad<br>File Edit Format View Help<br>20000; 12.8;cloth;67.99<br>21100; 3.1;glass; 23.45<br>40008;2.5; document;17.09<br>45678;4.3; device;19.99<br>Winde Ln 1, ( 100%<br>Write a complete Java program using File /O operation that can perform the following tasks:<br>a) Read all records from text file named Posini.txt in Figure 1<br>b) Analyze and write the following information to a text file named PostageSummary.txt<br>• Total weight of all item<br>Total price of all item<br>• The most heaviest item details<br>

Extracted text: Given the following text file named Posini.txt in Figure 1 that contains posting data of a courier company Posini. The data is comprised of postcode, weight (kg), content type and postage fee. Posini.bt - Notepad File Edit Format View Help 20000; 12.8;cloth;67.99 21100; 3.1;glass; 23.45 40008;2.5; document;17.09 45678;4.3; device;19.99 Winde Ln 1, ( 100% Write a complete Java program using File /O operation that can perform the following tasks: a) Read all records from text file named Posini.txt in Figure 1 b) Analyze and write the following information to a text file named PostageSummary.txt • Total weight of all item Total price of all item • The most heaviest item details
Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here