Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write Java Program //RealEstate.csv Instructions Create a package called assignment 2 and place all required code in that package. Part 1: Recursion [10marks] Place the

Write Java Programimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

image text in transcribed

//RealEstate.csv

image text in transcribed

Instructions Create a package called assignment 2 and place all required code in that package. Part 1: Recursion [10marks] Place the response to the following required methods in a class called Q1. Write a recursive method whose signature is the following: - public static double sumSeries(int N) This method, given N, will return the result of the following series. m(n)=31+52+73+94+(2N+1)N Part 2: RAddress Class [05 marks] Note In your handout directory there is a file called realEstate.csv. This csv file contains information pertaining to recorded real-estate listings in the Sacramento area. Specifically, it records the following information about each sale in that area. - Address - City - Number Beds - Number Baths - Square Feet of the Residence - Type - Price You will use this file as the data source for the following questions. Implement the following class to represent the sales. Note that the getters are just responsible for getting the related attributes. Part 3: Real-Estate Utilities Load Function [10 marks] Create a Class in the assignment2 package called RealEstateTransactions and include a method with the following signature in that file. public static ArrayList loadListings(String sPath) This method when given a file name that corresponds to where realEstate.csv exists will create an array list of all the real-estate listings in that file. Real-Estate Methods [50 marks] For each of the following methods you are to write your solution using a streams-based approach (using intermediate and final operations for each of the following questions). DO NOT USE REGULAR JAVA LOOPS FOR ANY OF THESE QUESTION. Each of these questions is worth 5 marks. - public static void q1(ArrayList> obList) This method will print out the top 10 Listings in obList (by Price). public static void q2 (ArrayList obList, String sCity) This method will print out all the listings in the given city ordered by price (ascending) public static int q3(ArrayList> obList) This method will return the count of all listings that are valued at greater than 400,000 . public static List>q4 (ArrayList obList, int n Bed) This method returns a new List of RAddress that is composed of all those entries in the original list that have a bed count greater than or equal to the given value; - public static List > q5 (ArrayList obList, Predicate> fPred, Comparator> fComp) This method will return a list that is generated by applying the Predicate (filter) and sorted by the given Comparator. - public static List q6 (ArrayList obList) This method will return a list of all the city names stored in the real -estate listings. All city names should be unique (only occur once in the list). The list itself should be sorted alphabetically. - public static RAddress q7 (ArrayListobList, String sName) Assuming that sName identifies a unique city, this method will return a RAddress record that correspond to the most expensive listing in that city. - public static List> q8 (ArrayList> obList) This method will return a List that shows the largest (by Square Footage) house for each city in the real-estate list. This list should be sorted by the house price (most expensive houses first). - public static List q9 (ArrayList obList) This method will return a list of strings that are colon seperated that list the city and the number of lisings for that city (i.e. ANTELOPE: 33 would indicate that there were 33 listings for the city of Antelope). The list should be sorted Alphabetically by city name. - public static List q10 (ArrayList> obList, Predicate> fPred, Function fMap) This method will just filter the given list (obList) by the given predicat using the supplied map function. Update Method [15 marks] It turns out that due the Success of the High-tech field all houses in Sacramento have increased their house prices by 10% except for those with 4 or more baths who have increased their price by 15%. All other locations had no increase in their prices. A new list should be created of real-estate listings and this new List written out to a file "NewListings" in the same CSV format that the original list was read in. Write a method update that preforms this action

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David J. Auer David M. Kroenke

13th Edition

B01366W6DS, 978-0133058352

More Books

Students also viewed these Databases questions