Apple's AirTags are handy for people who have memory problems, and often forget where we have left our stuff. AirTags can be attached to anything, and track locations as latitude and longitude. A program that simulates what AirTags do would be very useful.
Write a class that stores the latitude and longitude of some generic thing. The class must be generic, and its parameter is the class of the object to be located, e.g., a Car or a Gun. The location must be stored as a GenericPair of Double objects. To test your location class, write a driver class with a main method that creates two objects from your location class, one for locating a Car and one for locating a Gun. The initial location of the car and gun are unknown, but later the car's location is set to the UM campus (latitude 25.7179, longitude -80.2746), and then the gun's location is set to that of the car (by getting the car's location from its location object). The location of each object must be printed before being set, and then again after being set, e.g., ...
Before locating my Nissan Xterra $13500.00 is at an unknown location After locating my Nissan Xterra $13500.00 is at +++ 25.7179 +++ -80.2746 +++ Before locating my Beretta, 0/10 bullets is at an unknown location After locating my Beretta, 0/10 bullets is at +++ 25.7179 +++ -80.2746 +++The sequence of printing the initial location, setting the location, and printing the known location must be done in a separate generic method that accepts the thing, the latitude, and the longitude as its three parameters.