Look at what you are doing. I'll shorten it a bit so identical bits are more obvious:
if (a || b || c)
x;
else if ( d || b || c)
y;
That refactors - just to make it more obvious what is happening - to this:
if (a || b || c)
x;
else
if ( d || b || c)
y;
And "||" means "OR" - if either of the conditions on the left or right hand side are true, the whole expression is true.
So if either
b
or
c
are true, then the whole of the first condition is automatically true. Which means that if either
b
or
c
is true, the else condition will always be false, and they never contribute to the condition at all: the code in the else block will only get executed is
d
is true.
In your case, the only time the
else if
expression can be executed is if both
b
and
c
are false: if
startcall
is between 1800 and 800 and that remains true for the second test, so the second test will always be just
duration < 60
I'd suggest that you start by reading the question again, and applying the discount in separate tests:
if (right time of day)
{
apply 50% discount;
if (call is long enough)
{
apply extra discount;
}
}