Taxi Example Requirements Specification



1)     Create a class called Taxi that will represent a Taxi car on various work days, driving around and picking up passengers and latr dropping them off, all for a fare. You should include the following members in your design:

  • class contant called STANDARD_RATE which any class can use to set the current Taxi's rate for some particular passenger(s). This member should be able to take on decimal values.


  • class contant called STUDENT_RATE, similar to the STANDARD_RATE, but it should have a different value.


  • an instance constant that will be the identification number of that particular taxi car.


  • an instance variable that will be the name of the driver for a particular day.


  • an instance variable that represents the total amount of money earned for that day. This value will be reset to zero at the start of each new work day.


  • any other data members that make sense to have or that help your implementation.


  • an instance method called startWorkDay, which takes as a praameter then name of the drive for that day.


  • an instance method called stopWorkDay, which takes no parameters and ends the work day.


  • an instance method called pickUpPeople, which takes as a parameter the rate at whcih those passengers will be charged.


  • an instance method called dropOffPeople, which takes no parameters.


  • an instance method called drive, which takes as a parameter an integer that is the number of miles that the taxi will then drive, with or without passengers.


  • the toString method, inerited from the Object class. Please override the method to return an informative String about the instance at hand.


  • 2)     In addition to the requirements listed above, add any methods that you need in order to conserve the Object-Oriented and data abstraction approach. Follow all style guides, all commenting guides, and produce javadoc web pages when finished.

    3)     Then write a class to start a program running and test the Taxi class on a couple of instance objects. Verify that the results of the output are correct for you test program.