Unclear algorithm definition
Posted: Sun Apr 12, 2009 8:18 am
Hello everyone,
I'm new to this forum pleased to meet you all.
I was trying to solve a definition of an algorithm but it seems I'm pretty much stuck, due to what it seems an unclear definition in the book (and there's no solution either).
Here we go:
TELEPHONE RATES
The rate for use of a telephone depends on the time of call, which is measured as MPMs or minutes past midnight (ranging from 0 to 60 x 24).
The "day rate" from 6am to 6pm is given in dollars per inute, and the "night rate" as a proportion of this day rate.
If the rate is determined at the beginning of the call and remains fixed at that value, create an algorithm that computes the total cost for any call given the start time and the terminating time, both in MPMs.
If the rate can change during a call (when it lasts past the 6 o'clock times) then create the new algorithm to compute the cost.
Now, my problem is that I don't understand how can I extract a "proportion" from all this, because to me seems NOT DEFINED! Ok I could create the algorithm as black boxes with one labeled simply "Proportion", without worrying about the exact computation to be done, but... what do you think?
Thank in advance and happy easter! =)
FSX
I'm new to this forum pleased to meet you all.
I was trying to solve a definition of an algorithm but it seems I'm pretty much stuck, due to what it seems an unclear definition in the book (and there's no solution either).
Here we go:
TELEPHONE RATES
The rate for use of a telephone depends on the time of call, which is measured as MPMs or minutes past midnight (ranging from 0 to 60 x 24).
The "day rate" from 6am to 6pm is given in dollars per inute, and the "night rate" as a proportion of this day rate.
If the rate is determined at the beginning of the call and remains fixed at that value, create an algorithm that computes the total cost for any call given the start time and the terminating time, both in MPMs.
If the rate can change during a call (when it lasts past the 6 o'clock times) then create the new algorithm to compute the cost.
Now, my problem is that I don't understand how can I extract a "proportion" from all this, because to me seems NOT DEFINED! Ok I could create the algorithm as black boxes with one labeled simply "Proportion", without worrying about the exact computation to be done, but... what do you think?
Thank in advance and happy easter! =)
FSX