Turbo C help


Ok I had this problem

Any call started 6:00pm (1800hours) upto 8:00am (0800hours) will be discounted for 50%

And any call started from 8:00am (0800hours) upto 6:00pm (1800hours) is charged full price.

Any idea how to code it? thx in advance!
Last edited on
Call this code once per minute.
1
2
3
4
5
6
float rate = 0.06 // (6 cents per minute)

if (time > 18.00 || time < 8.00)
    rate /= 2.; // It gets halved for these times.

cost += rate;
thank you very much, worked now =)
Topic archived. No new replies allowed.