Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Page of 5 ZOOM Programming Project 4 House DataNote: When you turn in an assignment to be graded in this class, you are making the

Page

of 5

ZOOM

Programming Project 4 House DataNote: When you turn in an assignment to be graded in this class, you are making the claim that you neither gave nor received assistance on the work you turned in (except, of course, assistance from the instructor or teaching assistants).Crazy Town is full of crazy houses. It wants to create a program to perform some analysis on certain houses. Write a program called HouseData.java that will contain several methods. Your program will have several parallel arrays in the main method which you will use in the program. The data in the array is related to the other arrays by their position in the array; thus, the house at 304 Oak Aves square footage is 2634.23. Below are the arrays that you will need. Please note that these are sample arrays. When we test your program, we will be using different arrays.String array of house locations:304 Oak Ave209 Main Dr27 River St65 Park Pl21 Yew Rd52 Franklin Dr100 Baltic Ave200 Maple DrDouble array of square footage:2634.232434.672790.535893.1234902355.7879004356.54Double array of assessed price:90456.78345678.23892274.90804392.43784211.47823757.021453897.44342190.65Double array of distance in miles to center of town:6.47.31.97.91.23.97.510.7Your program will contain several methods: The first method, calcAvg(), calculates the average from all the values in the double array passed into the method. This method is passed in a double array and returns the double average. The method header is:public static double calcAvg(double [] values)

The second method, findHighest(), searches the double array passed in to find the highest value from the array This method is passed in a double array and returns the double highest value found in the array. The method header is:public static double findHighest(double[] values) The third method, findLowest(), searches the double array passed in to find the lowest value from the array This method is passed in a double array and returns the double lowest value found in the array. The method header is:public static double findLowest(double[] values) The fourth method, findHighestValues(), is passed in a String array of house locations and a double array. It will search through the double array to find the three highest values in the double array. It will return a String array that contains the house location of the houses associated with the highest three double values in the double array. The method header is: public static String[] findHighestValues(String[] locations, double[] values) The fifth method, findLowestValues (), passes in a String array of house locations and a double array. It will search through the double array to find the three lowest values in the double array. It will return a String array that contains the house location of the houses associated with the highest three double values in the double array. The method header is: public static String[] findLowestValues(String[] locations, double[] values) The sixth method, verifyHouseLocation(), will verify if a given String is a valid house location within Crazy Town. This method passes in the String array of house locations and the location being searched for. The method returns a boolean value of true or false based on whether the location was found within the house location array. If the house location is in the array, the method will return a value of true, and if the location is not in the array, the method will return false. Note, the locations must match exactly for the method to return true. The method header is: public static boolean verifyHouseLocation(String[] locations, String searchLocation)

The main method will contain the arrays needed for the program. The method will also do the following: Call the calcAvg() method, passing it the double array of square footage and print out the results. Call the calcAvg() method, passing it the double array of assessed price and print out the results. Call the findHighest() method, passing it the double array of assessed price and print the results. Call the findLowest() method, passing it the double array of distance and print the results. Call the findHighestValues() method, passing it the String array of house locations and the double array of square footage and print the results. (Note: You will need to use a foreach loop to print out the values from the array.) Call the findLowestValues() method, passing it the String array of house locations and the double array of distance and print the results. (Note: You will need to use a foreach loop to print out the values from the array.) Ask the user for a location Call the verifyHouseLocation(), passing it the String array of locations and the given location and print the results. All outputs should be rounded to two decimal spaces using printf().Below are two sample runs. The average square footage is: 3981.86The average assessed price is: 692107.37The highest assessed price is: 1453897.44The lowest distance is: 1.20The highest three square footage houses are:100 Baltic Ave65 Park Pl200 Maple DrThe lowest three distances are:21 Yew Rd27 River St52 Franklin DrEnter the city: 65 Park Pl65 Park Pl is a house in the array.

The average square footage is: 3981.86The average assessed price is: 692107.37The highest assessed price is: 1453897.44The lowest distance is: 1.20The highest three square footage houses are:100 Baltic Ave65 Park Pl200 Maple DrThe lowest three distances are:21 Yew Rd27 River St52 Franklin DrEnter the city: 980 Harrison St980 Harrison St is not a house in the array.Note for Gradescope Testing: Use nextLine().trim() for all String inputs You will also need to use printf() for printing and rounding your values.This and all program files in this course must include a comment block at the beginning (top) of the source code file that contains: the Java program name project description your name the version date the course number and sectionThe comment lines should look like this:/* * Java program name * * Project description * * Your name * The version date * The course number and section */

Before beginning this project, you will document your algorithm as a list of steps to take you from your inputs to your outputs. This algorithm will be due a week before the project submitted in Canvas. This will be graded for completion. It will be your responsibility to understand and correct any errors you might have with your algorithm. Each step of your algorithm will be added as a comment block within your code. You will have the comment block right above the code that performs the actions specified. For example, before your lines of code that ask the user for inputs, you would have a comment block that states what inputs you are requesting from the user.You will test your code using the provided JUnit tests. You should use these tests within IntelliJ to make sure that your code is running correctly. You will take a screenshot of your code passing all JUnit tests. Make sure that the screenshot has your header comment block in it so that we know it is your code running. Once it is, then you will submit your code to Gradescope. You will only have 4 submissions to Gradescope, so please make sure your code is running correctly in IntelliJ before submitting to Gradescope.You will submit your Java source code file (HouseData.java) to Gradescope. You will upload your screenshot of the JUnit tests by uploading the file to the Assignment link in Canvas.

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

Step: 3

blur-text-image

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 Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions