Thursday, 19 September 2013

Using conditionals to compare integers?

Using conditionals to compare integers?

I'm writing a method that returns a String. The String is the name of the
location that the person using the App is more likely to be in.
Ie. There are two locations, A and B. If the person is in location A the
time to reach location A should be less than location B. In this case the
String returned would be "A".
These are the steps I have came up with to write the method:
calculate distances between 2 locations
Compare these distances using conditional statements
Find the smallest value and represent this with a name in the form of a
string
I've already done #1. I'm very lost on as to how I can use conditional
statement to compare the integer values.. The scope of the assignment is
to use algorithm to write most of the method.. Can anyone tell me as to
how I can start on the algorithm part? (there's also a total of 7
locations I have to take into account)

No comments:

Post a Comment