Question
public Business(String formalName, String informalName, String startDate)
public double getLatitude()public double getLongitude()
public String getName()
public boolean setLatitude(double latitude)
public boolean setLongitude(double longitude)
public Business(String formalName, String informalName, String startDate, doublelatitude, double longitude)
public int getStartDay()public int getStartMonth()public int getStartYear()
Full descriptions of each method can be found in the documentation in the code. Google will likely be necessaryfor the last three methods.Note that no test cases will be provided on the autograder.
Solution Preview
These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.
/* Constructor that fully specifies a business. If _either_ the latitude* or longitude is invalid, both should be set to 0. See the set functions
* for the valid ranges of each coordinate.
*
* @param formalName The formal name of the business.
* @param informalName The informal name of the business.
* @param startDate The start date of the business, in MM/DD/YYYY format.
* @param latitude The latitude coordinate of the business.
* @param longitude The longitude coordinate of the business.
*/
public Business(String formalName, String informalName, String startDate,
double latitude, double longitude) {
this.formalName = formalName;
this.informalName = informalName;
this.startDate = startDate;
if(latitude >= -90 && latitude <= 90) {
setLatitude(latitude);
}else {
setLatitude(0);
}
if(longitude >= -180 && longitude <= 180) {
setLongitude(longitude);
}else {
setLongitude(0)...
By purchasing this solution you'll be able to access the following files:
Solution.java.