For this assignment 5 classes will be needed. The 5 classes are:

  • Location - a geographic location by a (longitude, latitude pair).
  • AirPlane - an airplane.
  • Radar - a radar tower. We will assume that radar towers have a range of exactly 150 miles.
  • RadarController - controls the radar towers, polls them for airplane locations, and so on. For this assignment we limit the number of radars controlled by the Radar Controller to be at most 5.
  • RadarControllerDriver- driver class for the project

For the Location class, the distance between 2 cities on the Earth's surface will be needed(great circle) shown below:

d = Math.acos((Math.cos(Lat1) * Math.cos(Lat2)) + (Math.sin(Lat1) * Math.sin(Lat2))* (Math.cos(Lon1 - Lon2)))

The main class should be the RadarControllerDriver class. The driver class will create 10 airplane objects and check if they are under radar or not. If they are, just list the name of the radar under who’s radius they are.

This is sample output of the program if you run with the given RadarController class:

  • [AirPlane: 000001 AT (42.23,71.10)] covered by [Radar: AT (42.33,71.00)]
  • [AirPlane: 000002 AT (42.21,71.03)] covered by [Radar: AT (42.33,71.00)]
  • [AirPlane: 000003 AT (40.00,65.00)] out of range.

In this assignment you will have 5 Radars 10 Airplanes. Using the formula, you should compute whether an airplane is covered by a radar or not. If it is, output that the airplane is in the radar range. Otherwise, print that it is not covered by any radar. If an airplane is covered by 2 or more radars, just printout either one of the radars. Here are method descriptions that should be in each class:

The RadarController class should have at least:

  • 1 constructor : RadarController - creates a new RadarController object with no association radars.
  • addRadar(Radar r) - Associates a Radar to the radar Controller;
  • findRadarforAirPlane(Plane p) that returns a radar object under which this plane is located;
  • removeRadar(Radar r) - Disassociates a radar with the RadarController.
  • 1 constructor Airplane - creates a new Airplane object with a given vin(vehicle identification number).

The Airplane class should have at least:

  • 1 constructor Airplane - creates a new Airplane object with a given vin(vehicle identification number).
  • A getter method to get the vin number of this plane
  • A getter method to get the location of this plane
  • A setter method to set the location of this plane (note: location an object too - corresponding to the Location class
  • toString()- returns a string representation of this airplane object. Example: [Airplane: AT ]

The Location class should have at least:

  • 2 constructors :
    • The default (no parameters) constructor should represent (0, 0 );
    • A constructor that sets the latitude and longitude (both doubles)
  • getDistance - A method that takes another Location object as a parameter and returns the distance from this location and returns that (as a double). Example usage: loc1.getDistance(loc2)
  • toString()- returns a string representation of the location. Refer to the sample output shown above to see the way it should be formatted.

The Radar class should have at least:

  • 1 constructor that creates a new radar object based on a Location object.
  • covers - a method that takes a Plane object as a parameter and returns a Boolean (true/false) depending on whether or not that plane is within the radius of this radar tower based on the plane's location, and this tower's location.
  • toString()- returns a string representation of the radar tower. Refer to the sample output above for the proper format.

The files delivered should be; Location.java, AirPlane.java, Radar.java, RadarController.java, RadarControllerDriver.java.

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.