PDA

View Full Version : How would you come about programming this question?


gloryjames
Oct 3, 2015, 10:20 AM
How would you come about programming this question? Can anyone help?
How would you write a program
called MobileRange that has the
(x,y) coordinates of 4 cities hard
coded using static final constants.
The program should ask the user for the maximum distance (i.e. range shown here) that you may be from each city center (in kms) before your cell phone service does
not work(using either the Scanner class or
the showInputDialog()) . You must
create a static function called getRange() that takes a city number as a parameter and the function should ask the user to enter the range for that city (e.g. "Enter
max cell phone connectivity
distance for city 1: ") and then return the range as an integer obtained from the user?

smoothy
Oct 3, 2015, 11:18 AM
Since this is homework.

Show us what you have so far...