13
answers
0
watching
276
views
28 Aug 2018

Programming Writing Montreal Maps In the following questions, you will write classes that allow one to suggest a route to get from one point to another on a metro or train line. Note that for all of these questions, we will make the simplifying assumption that the earth is flat and that everything resides in 2 dimensions. (There were metros before Columbus and Galileo, right?) 6. Write a class MetroStation in which you define a new type MetroStation. (10 points) A MetroStation is defined to have the following private properties: • String name This represents the name of the metro station (e.g. Atwater, McGill, etc) • double xPosition This represents the x location of the metro station. • double y Position This represents the y location of the metro station. An MetroStation object should have the following public methods/behaviors defined on it. • A constructor that takes as input a String stationName, a double x, and a double y. The constructor should initialize the properties name, xPosition, and yPosition to these three values respectively • A method getName() which returns the name of the Metrostation. • A method get XPosition () which returns the x location of the Metrostation • A method get Position () which returns the y location of the Metrostation • A method equals (Metrostation other) which returns a boolean representing whether the name property of the this MetroStation is equal to the name property of other.

For unlimited access to Homework Help, a Homework+ subscription is required.

Unlock all answers

Get 1 free homework help answer.
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in
Nelly Stracke
Nelly StrackeLv2
30 Aug 2018
Already have an account? Log in

Related questions

Related Documents

Weekly leaderboard

Start filling in the gaps now
Log in