"sara" writes:
Quote:
>i am studying a computer engineering and i started taking programming
using C++ since month
i have question i think it`s easy for you all *prof.programmer* but
it`s bit diffecult for me plzz i need your help. (: this is the
question:
|
It's hard for us to understand what your problem is. Perhaps you are just
bewildered by all the factoids the program contains? If so, just start
writing some code. Use up the factoids as the need arises. You will
probably end up with a kludgy thing you don't like. If you have time left,
you can then rewrite the thing to something you do like. For example, you
can do it for a call of duration 13.8 minutes on a local call. Right? Get
that going, then forge ahead. It looks like two functions *might* be a good
idea, one to compute the base rate and another to compute the discount. The
main program can call these, as appropriate.
Quote:
** A new telephone communication company needs a billing calculation
program. The cost of a call is based on the following three inputs that
should be entered by the user, and they are explained as follows.
>
1. Call Destination. Destination rates are calculated as shown below.
Note that only the cost of a local call is specified (should be
declared as constant); all other rates are calculated in terms of the
local rate.
>
a. For local calls ( L ), the cost is AED 0.35 / min
b. For national calls ( N ), the cost is 170% of a local call
c. For intra-continental calls ( I ), the cost is 210% of a local call
d. For inter-continental calls ( O ), the cost is 300% of a local call
|
The instructor probably wants you to use a switch statement there.
Quote:
2. Call Time. There are two rates based on the call time as shown
below, a normal rate and a discounted rate (should be defined as
constant). Although input times are shown in a 12-hour based clock, it
is emphasized that a 24-hour based clock should be used in your
program.
|
Don't forget the "emphasized" thing.
<snip>
You will have to make some assumptions where the exercise is not clear. Ex,
a call that starts in one rate and ends in another rate. Rounding, you
probably want to eliminate charges such as 12.333333 AEDs. Go ahead and
make assumptions, this is not rocket science.