Implement the comparable interface in earthquakemarker

Assignment Help JAVA Programming
Reference no: EM131804121

Sorting Data - Your Own Extension!

This assignment completes the project for this course. It builds on the assignments you did in the previous modules. As usual, you will not submit your code for grading, but you should do it because you'll learn and it's fun! This time our starter code is simply our solutions to module 5 (minus the optional content) so if you would like to simply copy your module 5 code over into the module6 files that we provide, please feel free. As before, we still we recommend you copy in individual methods just to be safe, rather than replacing whole files.

As before, you'll want the UnfoldingMaps javadoc and the Processing reference page open. IF YOU ARE WORKING OFFLINE, make sure you've got this downloaded.

Learning outcomes
- Use sorting to answer questions about data sets

- Implement the Comparable interface

- Complete a medium-sized project, going beyond defined requirements

In the final piece of your project, you will organize the earthquake data and compute statistics on it. You will then extend your project and share your work with other learners in this class.

To complete this project, follow these steps:

1. Find and open the starter code: You will add functionality to the classes you developed in the previous part of the project: EarthquakeCityMap.java, EarthquakeMarker.java, CityMarker.java, CommonMarker.java, LandQuakeMarker.java, OceanQuakeMarker.java. You will find these files (with our implementations) in the module6 package. You will also find three new files: AirportMap.java, AirportMarker.java and LifeExpectancy.java. These are files you might use in the extension (step 5 below). IF YOU ARE WORKING OFFLINE, you should once again make sure the variable offline is set to true.

2. Compare our implementation to yours. Look at the code and notice any differences between the way you implemented the functionality in module 5 and the way we did. Find at least one difference between your code and ours (could be helper method organization, variable names, the way we implemented a method, etc) and be ready to reflect on it for the quiz.

3. Implement the Comparable interface in EarthquakeMarker:
- add the keywords "implements Comparable<EarthquakeMarker>" to the class definition. After you change the header, but before you do step b, make a note of what error(s) occur in your code, where they occurred and why. We'll ask you about this on the quiz.

- implement the compareTo(EarthquakeMarker marker) method in the EarthquakeMarker class so that it sorts earthquakes in reverse order of magnitude.

4. Add and Implement the private method void sortAndPrint(int numToPrint) in EarthquakeCityMap. This method will create a new array from the list of earthquake markers (hint: there is a method in the List interface named toArray() which returns the elements in the List as an array of Objects). Then it will sort the array of earthquake markers in reverse order of their magnitude (highest to lowest) and then print out the top numToPrint earthquakes. If numToPrint is larger than the number of markers in quakeMarkers, it should print out all of the earthquakes and stop, but it should not crash.Call this method from setUp() to test it. An example input and output files are provided in the data folder: use test2.atom as the input file, and sortandPrint.test2.out.txt is the expected output for a couple different calls to sortAndPrint.

5. Add your own extension! This is the fun part and the main part of this final programming assignment. Add any extension you choose to the earthquake program as it stands. You will submit this extension for peer grading, as described in the Peer Review Assignment at the end of this module, following the Programming Assignment Quiz.

The only conditions for this piece is that your extension be (1) something you are interested in doing and (2) something that was not required in any of the previous programming assignments in this course. Also, you will be asked to submit a Peer Review assignment talking about your extension, so it would be a good idea to read over the requirements for that assignment before you get started programming. (It's the last assignment in this module).

We encourage you to get creative, but if you need a little inspiration, here are some ideas you are welcome to use along two different lines: direct extensions to the earthquake application, and working with other data sets. Again, these are just ideas. You are not required to use any of them.

Ideas for extending the functionality of the earthquake application:
- When clicking on a city, display a popup menu either on or off the map (off will be easier) which displays a count for the number of nearby earthquakes (within threatCircle) the average magnitude, and most recent earthquake. Get creative with the data you want to display.
- Style your earthquake or city markers to make them more aesthetically pleasing. You could use an image for the marker, or play around with PGraphics and PApplet drawing methods to make them how you want.
- Ensure that the popup info boxes about the earthquakes and cities are always drawn on top of the other graphical information (markers). There are some links that will be helpful with this in the module 5 programming assignment.
- Support clicking on markers which are still displayed while another is clicked rather than always resetting on the second click.
- Use keyboard events to change which earthquakes are displayed by age or only display cities which are above a certain latitude. etc.

Ideas for incorporating new data sources:

These extensions will be a little more difficult than just working within the earthquake application because you will have to work with new data and understand how it is represented. Depending on what you want to do, you might even write your own data parsing functions, or modify ours. However, even though these extensions are challenging, we think they will be a lot of fun.

New data source idea 1: Work with the airport and route data: There are two data files in the data directory: airports.dat and routes.dat which contain information about all of the airports in the world and routes between these airports, respectively. There are also two methods in ParseFeed.java for loading the data in these files, and we provide a starter file AirportMap.java that shows how to use the parser to read in the data from these files. Once you've read in the data, what you do with it is up to you. You might:

- Display all the airports in the world as features, and then display additional information about them when the user hovers over them.

- Display only a subset of the airports in the world, based on some criteria.

- Display airports, and when the user clicks on one, display the routes out of that airport.

- Display all the airports that you have been to.

- ... the list of possibilities is endless!

New data source idea 2: Work with data from the World Bank: The World Bank maintains a large number of datasets with some really interesting international data. You saw Mia work with one such dataset: life expectancy. We have included this data in your eclipse package as well as a method in ParseFeed to load its data. We also have a class called LifeExpectancy.java that implements the example Mia showed in module 3. You cannot use this as your extension, but you can modify it to do something different, and this would be a fine extension.

Attachment:- USCD map.rar

Reference no: EM131804121

Questions Cloud

Compute the selling price of a single bond on december : The market interest rate at the time of issuance was 12%. The bonds pay interest on June 30 and December 31
What makes the given indigenous tradition interesting to you : Describe in some detail one indigenous group you are interested in learning more about. What makes this indigenous tradition interesting to you?
Prepare computations showing how much profits will increase : Prepare computations showing how much profits will increase or decrease if the outside supplier's offer is accepted
Describe the benefits of learning outside the classroom : Describe the benefits or disadvantages of learning outside the classroom. That is, do you feel it was a worthwhile fieldtrip? Tell me why or why not?
Implement the comparable interface in earthquakemarker : Implement the Comparable interface in EarthquakeMarker - This is the fun part and the main part of this final programming assignment. Add any extension
Marketing communications offers incentive for customers : This type of marketing communications offers an incentive for customers to buy immediately and/or increase their purchase quantity:
Discuss what is the allocated cost of the sold items : What is the allocated cost of the sold items. The company allocates joint costs on a value basis
In traditional channel systems the channel member : In "traditional channel systems," the channel member who exerts control over other members is sometimes referred to as the:
Discuss how much interest receivable was collected : how much interest receivable was collected during the fiscal year

Reviews

len1804121

1/9/2018 1:24:55 AM

I have to submit this assignment by 12th. I am attaching a pdf which can provide you instruction. This assignment is of cousera module 6 USCD map foldings. Check the code in here, and please try to modify according to given instruction and explain the modification as well. And click on, UCSDUnfoldingMaps/UCSDUnfoldingMaps/ I do need need a code, I just have to upload screenshot of map explanation.

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd