Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 5 Aiman has recorded his daily expenses in a text file which consists of the date of expenses, type of expenses, amount of expenses

image text in transcribed

image text in transcribed

QUESTION 5 Aiman has recorded his daily expenses in a text file which consists of the date of expenses, type of expenses, amount of expenses and category of expenses as following: expenses.txt - Notepad Eile Edit Format View Help 23082017, food, 7.50, personal 23082017, fuel,50.00, office 24082017, food, 65.00, office 24082017, courier, 23.00, office 25082017, food, 12.00, personal 25082017, fuel, 80.00, personal 25082017, stationery, 17.00, personal 25082017, entertainment, 30.00, personal 25082017, rent,550.00, personal 26082017, food, 14.50, personal 26082017, toiletries, 37.00, personal 27082017, food,55, personal 27082017, entertainment,35.00, personal As a programmer, you have given the file which was named expenses.txt and are expected to write a complete Java program using File I/O to perform the following tasks: Read all records from the file named expenses.txt. Display on the screen, the total amount and details of all expenses done for office. Write all the details of personal expenses made by Aiman EXCEPT expenses for entertainment to the file name NecessityExpenses.txt where the expected output file is as follows: NecessityExpenses.txt - Notepad Eile Edit Format View Help 23082017, food, 7.50, personal 25082017, food, 12.00, personal 25082017, fuel, 80.00, personal 25082017, stationery, 17.00, personal 25082017, rent,550.00, personal 26082017, food, 14.50, personal 26082017, toiletries, 37.00, personal 27082017, food, 55, personal . Use exception handling operations to deal with input-output errors. (15 marks)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Rob, Carlos Coronel

6th International Edition

061921323X, 978-0619213237

More Books

Students also viewed these Databases questions

Question

Verify that the radius ratios for eightfold coordination are 0.732.

Answered: 1 week ago