subject

In this problem we are going to use ArrayLists and classes to design a road trip. You have three classes: GeoLocation. java which represents a geo location. A RoadTrip. java class which represents a road trip (or an ordered list of places), and a RoadTripTester. java class which brings them all together. In GeoLocation. java: Add a private instance variable called name which is a String. This represents the name of the location. Modify the Geolocation class constructor so that it is now of the format public GeoLocation(String name, double theLatitude, double theLongitude) Add a getter method for name called getName(). Update the toString so that it returns a String of the format San Francisco (37.7833, -122.4167) Now, you’ll also need to create a RoadTrip class. The RoadTrip stores an ordered list of locations, so you’ll need to have an ArrayList. You’ll also need to support these methods. // Create a GeoLocation and add it to the road trip public void addStop(String name, double latitude, double longitude) // Get the total number of stops in the trip public int getNumberOfStops() // Get the total miles of the trip public double getTripLength() // Return a formatted toString of the trip public String toString() We’ve given you a tester program to help get you started. The output from that program would be: 1. San Francisco (37.7833, -122.4167) 2. Los Angeles (34.052235, -118.243683) 3. Las Vegas (36.114647, -115.172813) Stops: 3 Total Miles: 572.9708850442705

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:10
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print “bad input.” and terminate immediately. next, the program determines and prints the prime factorization of the product, listing the factors in increasing order. if a prime number is not a factor of the product, then it must not appear in the factorization. sample runs are given below. note that if the power of a prime is 1, then that 1 must appear in t
Answers: 3
question
Computers and Technology, 25.06.2019 10:00
Why does delete questions and i checked today and me and my friends comments were deleted so was all my questions
Answers: 2
question
Computers and Technology, 25.06.2019 10:30
Tools used in a particular career depend on the tasks performed. true or false
Answers: 1
question
Computers and Technology, 25.06.2019 15:30
Finally, think about a way to add 1 to the score each time the ball touches the edge of the stage. see if you can add this to the project. answer quickly
Answers: 1
You know the right answer?
In this problem we are going to use ArrayLists and classes to design a road trip. You have three cla...
Questions
question
Mathematics, 16.08.2020 01:01
question
Mathematics, 16.08.2020 01:01
Questions on the website: 13722361