Question

Problem: This week you will write a user-defined class that will encapsulate a CTAStation. You wil then use arrays to store CTAStation data, and to store menus for user choices. Solution: Create a class that will implement a Geolocation with the following: GeoLocation #latitude: double #longitude: double +calcDistance(GeoLocation): double +calcDistance(double, double): double Create a class that will implement a CTAStation, which should inherit from GeoLocation, with the following: CTAStation -name: name location: String -opened: boolean -latitude: double -longitude: double -wheelchair: boolean +calcDistance(CTAStation): double +calcDistance(double, double): double
0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
Problem: This week you will write a user-defined class that will encapsulate a CTAStation. You wil...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • it is a java question, thank you very much!! Question 2 20 marks) Write a class...

    it is a java question, thank you very much!! Question 2 20 marks) Write a class named GeoCoordinate that retains the longitude and latitude of an object on earth. Both longi- tude and latitude are represented as double values that must be in the range [-90.0, 90.00. The class has the following constructors: GeoCoordinate0, which initializes the latitude to 0.0 (the equator, the longitude to 0.0 (the prime meridian) GeoCoordinate(double longitude, double latitude): initializes the longitude and latitudes to values...

  • CS1180 Lab 9 Students will learn how to create a user-defined class. Part 1. Create a...

    CS1180 Lab 9 Students will learn how to create a user-defined class. Part 1. Create a user-defined class. 1. Follow the UML diagram below to create a user-defined class, Automobile When implementing the constructors, use the default value of 0 for numeric types and "unknown" for VehicleMake and VehicleModel when not given as a parameter Implement the toString method in a format ofyour choosing, as long as it clearly includes information for all four member variables Make sure to include...

  • I am stuck on this question. Write the class, GeoLocation.java. You can refer to Name.java used...

    I am stuck on this question. Write the class, GeoLocation.java. You can refer to Name.java used in the lecture to complete the below exercises. Do the following: 1. Create two instance variables, lat and lng, both of which should be doubles. 2. Write the default constructor. 3. Write the non-default constructor. 4. Write 2 accessor methods, one for each instance variable. 5. Write 2 mutator methods, one for each instance variable. 6. Write a method that will return the location...

  • Assignment Requirements I have also attached a Class Diagram that describes the hierarchy of the inheritance...

    Assignment Requirements I have also attached a Class Diagram that describes the hierarchy of the inheritance and interface behaviors . The link to the PDF of the diagram is below MotorVehical.pdf Minimize File Preview User Define Object Assignment: Create a Intellij Project. The Intellij project will contain three user defined classes. The project will test two of the User Define Classes by using the invoking each of their methods and printing the results. You are required to create three UML...

  • In Java. Write a GUI contact list application. The program should allow you to input names...

    In Java. Write a GUI contact list application. The program should allow you to input names and phone numbers. You should also be able to input a name and have it display the previously entered phone number. The GUI should look something like the following, although you are welcome to format it in any way that works. This should be a GUI application with a JFrame. The program should contain two arrays of Strings. One array will contain a list...

  • Using java : In this exercise, you need to implement a class that encapsulate a Grid. A grid is a useful concept in crea...

    Using java : In this exercise, you need to implement a class that encapsulate a Grid. A grid is a useful concept in creating board-game applications. Later we will use this class to create a board game. A grid is a two-dimensional matrix (see example below) with the same number of rows and columns. You can create a grid of size 8, for example, it’s an 8x8 grid. There are 64 cells in this grid. A cell in the grid...

  • Objectives: 1. Classes and Data Abstraction?2. User-defined classes?3. Implementation of a class in separate files Part...

    Objectives: 1. Classes and Data Abstraction?2. User-defined classes?3. Implementation of a class in separate files Part 1: In this assignment, you are asked: Stage1:?Design and implement a class named memberType with the following requirements: An object of memberType holds the following information: • Person’s first name (string)?• Person’s last name (string)?• Member identification number (int) • Number of books purchased (int)?• Amount of money spent (double)?The class memberType has member functions that perform operations on objects of memberType. For the...

  • First you will need to write three classes: Game Shoe Assignment within each class you will...

    First you will need to write three classes: Game Shoe Assignment within each class you will add two fields and a constructor. For Game you will need to keep track of the name of the game (String) and the number of players (int). The constructor will be in the order (String, int). For Shoe you will need the shoe size (double) and the brand (String). The constructor will be in the order (double, String). For Assignment you will need the...

  • In Java, Write a class encapsulating a restaurant,which inherits from Store. A restaurant has the following...

    In Java, Write a class encapsulating a restaurant,which inherits from Store. A restaurant has the following additional attributes: how many people are served every year and the average price per person. code the constructor, accessors, mutators, toString and equals method of the new subclass; also code a method returning the average taxes per year. You also need to include a client class to test your code for both the parent class and the subclass. Code for Store below(Super class aka...

  • In Java, Implement a class MyArray as defined below, to store an array of integers (int)....

    In Java, Implement a class MyArray as defined below, to store an array of integers (int). Many of its methods will be implemented using the principle of recursion. Users can create an object by default, in which case, the array should contain enough space to store 10 integer values. Obviously, the user can specify the size of the array s/he requires. Users may choose the third way of creating an object of type MyArray by making a copy of another...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT