Question: Create a location class which contains GPS coordinates for latitude and longitude expressed in decimal format. Create a constructor which accepts two decimal numbers as

Create a location class which contains GPS coordinates for latitude and longitude expressed in decimal format. Create a constructor which accepts two decimal numbers as latitude and longitude respectively. Northern latitudes are positive, southern latitudes are negative. If expressed in decimal form, eastern longitudes are positive, western longitudes are negative.

Create a MountainBikeRide class which consists of instance variables to maintain the name of the ride, the GPS coordinates of the starting position, the distance of the ride, the elevation gain of the ride, and an integer value to store the rating of the ride with values between 1 and 10, 10 being the best, 1 being the worst.

Implement getters and setters for all of the instance variables as well as overloading the constructor to have at least two constructors with various parameters. The class should implement the Comparable interface to compare rides based on the rating of the ride. Provide a toString method which will print a one line description of the ride.

Create a Ride class which will prompt the user for information required to instantiate several MountainBikeRide objects and test the compareTo method as described above. Your project should include method calls to test all of the methods in the classes as well as print out relevant information.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!