Question: by using the function BufferedReader function, How to sum up the price in the file that share the same consumer WITH TE ROLL NUMBER..For example,

by using the function BufferedReader function, How to sum up the price in the file that share the same consumer WITH TE ROLL NUMBER..For example, file one has all user's purchase history and one other file has the specific ROLL NUMBER AND name of the user (one name only)..the language use is java language..

File1.txt(contain ONE LINE OF ROLL NUMBER AND username)

metth

File2.txt(contain MANY roll number, username, product, price)

1,adam, Milk, 10

2,metth, Chips,20

2,metth, Milk, 10

2,matth, Eggs,5

1,adam,Eggs, 20

3,andrew, ethan, Milk, 50

below code that i currently use:

File myFile = new File("File2.txt"); File filss = new File("File1.txt"); BufferedReader b = new BufferedReader(new FileReader(filss));

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!