Object-oriented programming (turbo pascal)
CAN YOU PLEASE GIVE ME SOME POINTERS ON HOW TO CODE THE FOLLOWING: (I HAVE
TRIED MANY TIMES (NEW LEARNING AT PASCAL)
A motorway toll system operates as follows:
a private car passing through the toll is charged 1, and all other motor
vehicles are charged 5. At the start of the day, the toll system's opening
balance is initialised, and then an unknown number of vehicles are processed
during the course of the day. At any stage during the day, the toll system can
be asked to display the current balance or the number of different vehicles
(cars and non-cars) processed. The system automatically displays the closing
balance at the end of the day, and also the total number of vehicles processed.
The toll system is based on the principles of a bank account, which can
(a) accept an amount
(b) process a withdrawal
(c) maintain a current balance, and
(d) issue a current balance on demand.
Write a menu-driven application (using Object Orientation techniques) for the
above specification, in which a Toll class (tTollClass) is declared as a
descendant of an Account class (tAccountClass). The application should:
initialise a Toll object (an instance of class tTollClass),
process n vehicles (thus simulating a day's activity) until the user decides to
quit,
display the data (as in the specification) and close.
(Note that it would also be possible to declare a class tMenuClass, which
handles all menu activities, such as displaying a menu, displaying a prompt,
and getting a user key-press. Optionally, therefore, write a unit MenuApp, in
which this class and its properties and methods are defined, and incorporate
this unit into your application).