subject

Edhesive JAVA The scenario: Lily's Longitude/Latitude Write a program into which we could enter Lily’s Longitude and Latitude data. Each time a new longitude and latitude is entered it should ask if you want to continue - the program should continue to ask for input if the user enters 1, and stop when the user enters 0. If an invalid pair of coordinates entered by the user (i. e. with latitude not between -90 and 90 inclusive or longitude not between -180 and 180 inclusive) then the program should print "Incorrect Latitude or Longitude".
Once the user has finished inputting data, the program should display the farthest distance traveled by Lily in each direction (you may assume the user has entered at least one valid longitude/latitude pair). However any invalid pairs of coordinates should be ignored when calculating these values - this includes ignoring a valid latitude if it is entered with an invalid longitude and vice-versa.
Sample Run:

Please enter the longitude:
69.938
Please enter the latitude:
41.678
Would you like to enter another location (1 for yes, 0 for no)?
1
Please enter the longitude:
69.862
Please enter the latitude:
41.755
Would you like to enter another location (1 for yes, 0 for no)?
1
Please enter the longitude:
69.947
Please enter the latitude:we are
41.829
Would you like to enter another location (1 for yes, 0 for no)?
1
Please enter the longitude:
69.988
Please enter the latitude:
300
Incorrect Latitude or Longitude
Would you like to enter another location (1 for yes, 0 for no)?
1
Please enter the longitude:
69.904
Please enter the latitude:
41.827
Would you like to enter another location (1 for yes, 0 for no)?
0
Farthest North: 41.829
Farthest South: 41.678
Farthest East: 69.947
Farthest West: 69.862

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:00
Meenu wants to create a high quality drawing in a variety of colours. which device should she use for the same?
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
The camera still is bad even with the new iphone xr and especially in low light it is even worst because you can see the pixels more if its in low light. if all you apple customers want apple to fix this then lets fill there feedback with complaints about the
Answers: 1
question
Computers and Technology, 24.06.2019 09:50
Self contained sequences of actions to be performed are? a. expressions b. algorithms c. functions d. formulas
Answers: 1
question
Computers and Technology, 24.06.2019 12:10
What is it called during the editing process when the processor ensures that a character holding a coffee mug from one angle is holding the same mug in the same way when the shot switches to another camera at another angle? cinematography continuity technology prop use
Answers: 1
You know the right answer?
Edhesive JAVA The scenario: Lily's Longitude/Latitude Write a program into which we could enter Lil...
Questions
question
Mathematics, 28.06.2019 10:30
question
Mathematics, 28.06.2019 10:30
question
English, 28.06.2019 10:30
question
Biology, 28.06.2019 10:30
Questions on the website: 13722360