Question: Create a public class named Location. Location should store three pieces of data: a latitude and a longitude, both as double values, and a description
Create a public class named Location. Location should store three pieces of data: a
latitude and a longitude, both as double values, and a description as a String.
Provide a public constructor that allows all fields to be set, with the description first, followed
by the latitude and longitude.
Following the encapsulation pattern we have introduced, provide both a setter and a getter for
the description as setDescription and similar. Provide only a getter for the latitude and
longitude. Finally, reject invalid latitude and longitude values and null descriptions using
assert. Valid longitude values are between and inclusive, while valid latitude
values are between nd also inclusive. IN JAVA
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
