hi.. thanks for the wornderful rply. i do learn from
my mistake.. i must to read and try. until i can do
it.
i read some books about c then i found out i must
convert it. then when i try i got the answer.
   i have this code. if you willing to help. pls help
me. i also try to read buks to find another answer.
thanks....

if (dayCall>=1 && dayCall<=5) 
// 1 represent monday and 2 represents tuesday, so
on..
   { if (timestart>=0600 && timestart<=1800)
       bill=(2.5 * timeduration);
       
   else bill=(2.0 * timeduration);
        pf("bill: %.2lf",bill);
   }
else
    if (dayCall>=6 || dayCall<=7)
   {    bill=(1.5 * timeduration);
        pf("bill: %.2lf", bill);
    }
   else 
      pf("Invalid\n");/* why the computer say matching
if or else.. when i input 0 or 9. they cannot find. or
tell the computer invalid... i used already control
structure. */
}
--- Shyan Lam <[EMAIL PROTECTED]> wrote:

> Reply embedded...
> 
> > -----Original Message-----
> > From: [email protected]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> > Eliacem Galon
> > Sent: Thursday, August 17, 2006 1:00 AM
> > To: [email protected]
> > Subject: Re: [c-prog] RE: Telephone Bill (need
> some help!!!!) C
> > programming
> > 
> > thanks for the rply.it was my cousin who send that
> it
> > many times coz they felt confuse that my msg was
> sent.
> > so she decided for the one or twice. im confusing
> > that: when i'm using 24 hrs format, sample of this
> > when the person call at 1259-1305. the answer is 6
> > minutes and then when the computer calculate the
> > answer is 46. 
> 
> That explains my phone bill ;-)
> 
> > why this happened? 
> 
> You made a mistake somewhere.  If you truly want to
> learn, show your code so
> that someone will point out your mistake.  Learn
> from own mistakes and
> understand the reasons is the best way to learn,
> IMHO.  
> 
> I believe this is what you can do: convert hh:mm to
> minutes before computing
> the difference in minutes:
> 
>     13:05 = 13 * 60 + 05 = 785 min
>     12:59 = 12 * 60 + 59 = 779 min
> 
> The difference is 6 minutes.
> 
> This should work as long as both times are within
> the 24 hour period.  You
> have to take special care when the clock passes
> midnight.
> 
> 
> > then i should round
> > the remaining seconds to mins.. 
> 
> In that case, you might want to consider converting
> hh:mm:ss to seconds
> first, than computing the difference in seconds, and
> finally round the
> results to minutes.
> 
> Similarly you have to take special care when the two
> times cross midnight.
> 
> 
> HTH
> Shyan
> 
> 
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/c-prog/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to