Board index » delphi » Desperate help on Object-oriented programming (turbo pascal)

Desperate help on Object-oriented programming (turbo pascal)

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).

 

Re:Desperate help on Object-oriented programming (turbo pascal)


Quote
In article <20021028130523.12968.00000...@mb-mb.aol.com>, HaqueF6 wrote:
> 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)

Ask your teacher.

Re:Desperate help on Object-oriented programming (turbo pascal)


HaqueF6 schrieb:

Quote
> 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)

Why not post your existing code here so that we can spot your problems?
We don't do homework of students or school here from scratch. What we do
is to help with detailed problems when there is already some code.
Otherwise you WON'T LEARN ANYTHING, and PLEASE stop writing all
uppercase, that's considered as shouting - which is VERY unpolite here.

Greetings

Markus

Re:Desperate help on Object-oriented programming (turbo pascal)


Quote
"Markus Humm" <markus.h...@freenet.de> wrote in message...

> > 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)

> Why not post your existing code here so that we can spot your
problems?
> We don't do homework of students or school here from scratch. What
we do
> is to help with detailed problems when there is already some code.
> Otherwise you WON'T LEARN ANYTHING, and PLEASE stop writing all
> uppercase, that's considered as shouting - which is VERY unpolite

here.

It's quite funny how the same sort of problem goes around. I had to do
the same sort of problem in C++ which I considered much tricker to do
than in Turbo Pascal.

However I agree with you, that those sorts of problems should not just
be resolved without no understanding of it, yet I consider that some
schools (or teachers) go to the trouble of checking for these sorts of
activitys going on (in most events it's really asking for trouble when
you use their networks & systems cause they can track it down more
easily, believe it or not) & the penalty is just as good as not
handing in anything!

However it is also my view that something as silly as this project
would be, you would be greater off taking the time of resourcing that
the program may use & find better examples of Pascal programming into
writing your own masterpiece rather than working out which cars get
the discount (that sounds like the sort of thing some programmer would
have written for the M1 Motorway!). However methinks I would be the
only person to avoid such boring programming (but in theory you would
have a better understanding if you were writing something good not
this dribble they hand out).

Regards,
Ross.

Other Threads