Answered step by step
Verified Expert Solution
Question
1 Approved Answer
QUESTION 3 (15 MARKS) Given the following text file named PosIni.txt in Figure 1 that contains posting data of a courier company Posini. The data
QUESTION 3 (15 MARKS) 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. Poslni.bit - Notepad File Edit Format View Help 20000;12.8;cloth; 67.99 21100;3.1;glass;23.45 40000;2.5;document;17.09 45678;4.3; device;19.99 Windc In 1,(100 Figure 1: PosIni.txt Write a complete Java program using File I/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 Postage Summary.txt: Total weight of all item Total price of all item The most heaviest item details Write a complete Java program using File I/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 The expected output as given in Figure 2: PostageSummary.bit. Notepad File Edit Format View Help Monthly Summary 1) The total weight of all item is 22.7kg 2) The total price of all item is RM128.52 3) The most heaviest item details: Postcode: 20000 Weight: 12.8kg Content type: cloth Postage fee: RM67.99 Figure 2: Postage Summary.txt c) Close all file streams in used. d) Apply exception handling mechanism in the program (15 marks)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started