Мне нужна помощь в понимании моего java кода
I am currently wondering how a certain java program would be written properly. [Sample Console Output/File Output][1] A department store manages their sales in the form of files. A sale is recorded on each line of a sales file in this format: 22349999990603193150 The first 4 digits are the department code(2234) The next 6 digits are the item number (999999) The next 6 digits are the date(060319) The final digits are the price in pennies(3150) Write a program that will parse a sales file and print a report for each sale Your program should: Prompt a user for the input sales file name Prompt a user for the output report file name Create your own input file with at least 4 items Read each line of the sales file Print the following to the console and output report file The department store name: MCC Department Store The date in format full month name, day, 4 digit year The department name The item number The price, tax and total The department ranges are: 1000-1999 Clothing 2000-2999 Hardware 3000-3999 Food 4000-4999 Toys 5000-5999 Sporting Goods 6000-9999 – Misc. [1]: https://i.stack.imgur.com/RMAYp.jpg
Что я уже пробовал:
My current code is as follows: 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();