Assignment 4:
EZ Pass project
Include constructors for each class, accessor and mutator methods as needed.
Include a toString method in each class that prints out the name of the subclass using the getClass() method of class Object followed by the instance variables, each preceded by a description.
EZPassAccount
-
Create a class named EZPassAccount that can keep track of its account information, such as owner info, credit card, balance. Each account can have several tags associated with it. Each tag has a unique serial number that is scanned and belongs to a specific vehicle.
Note: there are different types of vehicles. You will probably need a Vehicle class (or set of related classes).
-
An account should be charged when one of its tagged vehicles passes a toll booth. Beware of insufficient funds!
-
The credit card information is stored for each account. The CreditCard class has the information about the card. Make sure a credit card number is valid using the Mod 10 check!
-
The system works with prepayments. Tolls are deducted from the balance. The owner should be able to make payments to increase the available balance.
TollBooth
- There are different types of toll booths:
- Bridge / Tunnel
- Expressway
-
At some toll booths, the toll is charged whenever the vehicle uses the bridge/tunnel and sometimes the toll is only collected in one direction.
-
Each toll booth has its toll price. The price can change depending on the
- type of vehicle bearing tag (truck is charged per axle)
- time of day (off peak hours can be cheaper)
- number of passengers (carpool special)
- All toll booths have common characteristics. They should inherit from a common base class. Should the base class be an interface or abstract since only specialized versions exist?
This system is not complete yet. Which features can you think of that we missed?
Construct a UML class diagram for your classes. Confused about how it should look? Look at this file.
Bonus: Think of an appropriate interface to create it in more than one class.
Confused about how the EZ Pass works? Visit their website http://www.ezpass.com
What to Submit?
Only one group member should submit the PDF version of the UML diagrams file through Blackboard.
The name of the group members should be written on top of the submitted file.
Group members individually should submit the Peer Evaluation Form. ( this form is confidential )
One group member should be responsible of printing the homework and bringing it to the class on due date.