link to old post shows code: http://www.daniweb.com/software-development/java/threads/440001/output-incomplete-text-file
program to:
A. Develop an application that reads your listings.txt file, analyzes the property listed per agent, and outputs a report to an agentreport.txt file. Your application should do the following:
1. Prompt the user for the name of the input file (listings.txt).
2. Open listings.txt file and read in property listings.
3. Store each property type into a Set.
a. Convert property type to upper case before adding to your Set using method(s) from String class.
b. Sort your Set of property types alphabetically.
4. Use a Map to calculate total property listed in dollars and cents for each agent id.
Note: Agent id would be the key, and accumulated total of property listed would be the value.
• Sort your Map by agent id.
• Create an agentreport.txt file.
5. Use an Iterator to iterate through your Set and write your sorted set of property types sold by the agents to the agentreport.txt file.
6. Iterate through your Map to write your sorted pair of agent id and total property listed to the agentreport.txt file.
So I have written the code, and my output file is missing data.
Here is an example of the input and then the output files (what they should look like)
Example listings.txt file:
110001 commercial 500000.00 101
110223 residential 100000.00 101
110020 commercial 1000000.00 107
110333 land 30000.00 105
110442 farm 200000.00 106
110421 land 40000.00 107
112352 residential 250000.00 110
Example agentreport.txt file:
COMMERICAL
FARM
LAND
RESIDENTIAL
101 600000.00
105 30000.00
106 200000.00
107 1040000.00
110 250000.00
When I run the program I only get
COMMERICAL
FARM
LAND
RESIDENTIAL
to show up in agent agentreport.txt.
What should the listing.txt file actually look like? does it need any code to format it correctly?
thanks