Prompt the user for the name of the input file listingstxt


Application 1:

Write an application in JAVA that reads from a text file called: listings.txt, analyzes the property listed per agent, and outputs a report to an text file called: agentreport.txt file. The 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 the Set using method(s) from String class.

b. Sort the 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 the Set and write a 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.

Application 2:

Write an application in JAVA that reads the text file: listings.txt, analyzes the properties listed, and outputs an overview of properties listed to an overview.txt file. Your application should do the following:

1. Prompt the user for the name of the input file (listings.txt).

2. Open the listings.txt file and read in property listing information using a buffered FileReader.

3. Count the total number of property listings for sale.

• Use buffered FileWriter to write the count of the number of property listings to your overview.txt file.

4. Calculate the total value of property for sale.

• Use a buffered FileWriter to write the total value of properties currently for sale.

5. Store each property id into an ArrayList.

a. Sort the ArrayList of property ids using natural ordering.

b. Use a for-each loop to iterate through the sorted ArrayList and write property ids to overview.txt file using buffered FileWriter.

6. Use buffered FileWriter to write the total value of the properties listed and the total number of properties currently for sale.

Note: All code needs to be commented well using single line and/or multi line comments, and explainging program flow and logic in terms easily understandable by a begginer programmer.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Prompt the user for the name of the input file listingstxt
Reference No:- TGS01673258

Now Priced at $40 (50% Discount)

Recommended (96%)

Rated (4.8/5)