As a competent programmer, your understanding of control structures, your ability to design and develop algorithms, and your proficient use of data structures will help you design and develop applications to meet customer requirements. You will need to develop a Java application to meet the requirements of this assignment. It is recommended that you use NetBeans (see web link below for download) to develop this.

You will use the following scenario to complete the task: Your client is a real estate office manager who needs to run reports on property listings. You will build two applications that will provide two different reports. One report is focused on the amount of property an agent is selling. The other report provides an overview of the types of property for sale.

Your listings file will contain property number, property type, price, and agent id.

Note: You will submit all .java and .class files in one zipped folder. If you developed this application using NetBeans, it is recommended that you zip and submit the entire NetBeans project folder.

Task 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:

  • Prompt the user for the name of the input file (listings.txt).
  • Use an unbuffered file input stream to open listings.txt file and read in property listings.
  • Store each property type into a Set.
    • Convert property type to upper case before adding to your Set using method(s) from String class.
    • Sort your Set of property types alphabetically.
  • 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.
  • 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 using unbuffered file output stream.
  • Iterate through your Map to write your sorted pair of agent id and total property listed to the agentreport.txt file using unbuffered file output stream.

Task B

Develop an application that reads your listings.txt file, analyzes the properties listed, and outputs an overview of properties listed to an overview.txt file. Your application should do the following:

  • Prompt the user for the name of the input file (listings.txt).
  • Open the listings.txt file and read in property listing information using a buffered FileReader.
  • 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.
  • Calculate the total value of property for sale. Use a buffered FileWriter to write the total value of properties currently for sale.
  • Store each property id into an ArrayList.
    • Sort the ArrayList of property ids using natural ordering.
    • Use a for-each loop to iterate through the sorted ArrayList and write property ids to overview.txt file using buffered FileWriter.
  • Use buffered FileWriter to write the total value of the properties listed and the total number of properties currently for sale.
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.