Board index » delphi » for all you brains this should be real easy please help

for all you brains this should be real easy please help

1. Write a Program that receives an integer value from the user that
represents a number of seconds.If the user clicks on the convert button,the
input is converted to the format hours:minutes:seconds .If the user enters
40 seconds into the editbox for eg, the result 00:00:40 must be displayed.If
the user enters 40 000seconds the result should be 11:06:40. Note that if
the resulting number of hours, minutes or seconds is less than 10,it should
be preceded by a 0.
 

Re:for all you brains this should be real easy please help


Quote
Philippa (phillipagla...@hotmail.com) wrote:

: 1. Write a Program that receives an integer value from the user that
: represents a number of seconds.If the user clicks on the convert button,the
: input is converted to the format hours:minutes:seconds .If the user enters
: 40 seconds into the editbox for eg, the result 00:00:40 must be displayed.If
: the user enters 40 000seconds the result should be 11:06:40. Note that if
: the resulting number of hours, minutes or seconds is less than 10,it should
: be preceded by a 0.

I think you should do your own homework assignment.

If you at least attempt to write the program yourself, but post questions
whenever you need help, we'll be glad to work with you.
--
Rick Carter
carte...@email.uc.edu

Re:for all you brains this should be real easy please help


Try something like this.

procedure onconvertclick(sender:Tobject)
var minutes,hours,seconds.Integer;
    minutesStr,hoursStr,secondsStr:string;
begin
  seconds:=strtoint(editbox1.text);
  hours:=seconds div 3600;
  minutes:=(seconds mod 3600) div 60;
  seconds:=(seconds mod 60);

 hoursStr:='0'+inttostr(hours);
 MinutesStr:='0'+inttostr(minutes);
 SecondsStr:='0'+inttostr(seconds);

labelResult.caption:=format('%s:%s:%s',[copy(hoursStr,length(hoursStr)-1,2),
copy(minutesStr,length(minutesStr)-1,2),copy(secondsStr,length(secondsStr)-1
,2);
end;

bye

Marco

Quote
Philippa <phillipagla...@hotmail.com> wrote in message

3af5927...@news1.mweb.co.za...
Quote
> 1. Write a Program that receives an integer value from the user that
> represents a number of seconds.If the user clicks on the convert
button,the
> input is converted to the format hours:minutes:seconds .If the user enters
> 40 seconds into the editbox for eg, the result 00:00:40 must be
displayed.If
> the user enters 40 000seconds the result should be 11:06:40. Note that if
> the resulting number of hours, minutes or seconds is less than 10,it
should
> be preceded by a 0.

Re:for all you brains this should be real easy please help


In article <3af5927...@news1.mweb.co.za>, "Philippa"

Quote
<phillipagla...@hotmail.com> writes:
>1. Write a Program that receives an integer value from the user that
>represents a number of seconds.If the user clicks on the convert button,the
>input is converted to the format hours:minutes:seconds .If the user enters
>40 seconds into the editbox for eg, the result 00:00:40 must be displayed.If
>the user enters 40 000seconds the result should be 11:06:40. Note that if
>the resulting number of hours, minutes or seconds is less than 10,it should
>be preceded by a 0.

See borland.public.delphi.internet. It's nothing to do with the internet so I
don't know why you've sent it there and every delphi newsgroup you can find.

Alan Lloyd
alangll...@aol.com

Re:for all you brains this should be real easy please help


Quote
"Philippa" <phillipagla...@hotmail.com> wrote:
>1. Write a Program that receives an integer value from the user that
>represents a number of seconds.If the user clicks on the convert button,the
>input is converted to the format hours:minutes:seconds .If the user enters
>40 seconds into the editbox for eg, the result 00:00:40 must be displayed.If
>the user enters 40 000seconds the result should be 11:06:40. Note that if
>the resulting number of hours, minutes or seconds is less than 10,it should
>be preceded by a 0.

It can't be done in Delphi.  Try Visual Basic or C++.

Re:for all you brains this should be real easy please help


Quote
"Jud McCranie" <jud.mccra...@mindspring.com> wrote in message

news:9fvbftgj5j767ml1llr329p2llo3np81b5@4ax.com...

Quote
> "Philippa" <phillipagla...@hotmail.com> wrote:

> >1. Write a Program that receives an integer value from the user that
> >represents a number of seconds.If the user clicks on the convert
button,the
> >input is converted to the format hours:minutes:seconds .If the user
enters
> >40 seconds into the editbox for eg, the result 00:00:40 must be
displayed.If
> >the user enters 40 000seconds the result should be 11:06:40. Note that if
> >the resulting number of hours, minutes or seconds is less than 10,it
should
> >be preceded by a 0.

> It can't be done in Delphi.  Try Visual Basic or C++.

I hope that was a Joke???
(The lack of smileys, etc. indicates that you actually
 mean that this can't be done in Delphi?)

Dag.

Re:for all you brains this should be real easy please help


On Sun, 06 May 2001 21:44:31 -0400, Jud McCranie

Quote
<jud.mccra...@mindspring.com> wrote:

>It can't be done in Delphi.  Try Visual Basic or C++.

Huh? It would be easy. No-one's prepared to do it for the kid, because
it's obviously a school assignment, and he's cross-posted it to most
Delphi ng's.

As if you could do anything in VB that you can't do easier in Delphi!

Re:for all you brains this should be real easy please help


In article <gUsJ6.6346$Sq.618...@juliett.dax.net>, Dag Sunde
<d...@orion.no> writes

Quote

>> It can't be done in Delphi.  Try Visual Basic or C++.

>I hope that was a Joke???
>(The lack of smileys, etc. indicates that you actually
> mean that this can't be done in Delphi?)

Are Monty Python videos banned in Oslo, or is the dead parrot sketch
taken as a national insult?
--
Barney Tyrwhitt-Drake

Re:for all you brains this should be real easy please help


Quote
"Dag Sunde" <d...@orion.no> wrote:
>I hope that was a Joke???
>(The lack of smileys, etc. indicates that you actually
> mean that this can't be done in Delphi?)

Yes, it was a joke.  I thought it would be clearly a joke to
even slightly experienced Delphi users.  I'm sorry if it wasn't
clear.  Of course, it would be nice if he went back to his
teacher and said that it couldn't be done in Delphi.

Re:for all you brains this should be real easy please help


Quote
"Jud McCranie" <jud.mccra...@mindspring.com> wrote in message
> clear.  Of course, it would be nice if he went back to his
> teacher and said that it couldn't be done in Delphi.

:) it would, wouldn't it.

Re:for all you brains this should be real easy please help


On Sun, 06 May 2001 21:44:31 -0400, Jud McCranie

Quote
<jud.mccra...@mindspring.com> wrote:
>"Philippa" <phillipagla...@hotmail.com> wrote:

>>1. Write a Program that receives an integer value from the user that
>>represents a number of seconds.If the user clicks on the convert button,the
>>input is converted to the format hours:minutes:seconds .If the user enters
>>40 seconds into the editbox for eg, the result 00:00:40 must be displayed.If
>>the user enters 40 000seconds the result should be 11:06:40. Note that if
>>the resulting number of hours, minutes or seconds is less than 10,it should
>>be preceded by a 0.

>It can't be done in Delphi.  Try Visual Basic or C++.

ROTFL!
just for the teacher!

Adolf
--
Be careful!
If you call me crazy I will take it as a compliment!

Re:for all you brains this should be real easy please help


;-)

Dag.

Quote
"Jud McCranie" <jud.mccra...@mindspring.com> wrote in message

news:moldftonfhgbvrb9qm2i1q486ob16cpbcq@4ax.com...
Quote
> "Dag Sunde" <d...@orion.no> wrote:

> >I hope that was a Joke???
> >(The lack of smileys, etc. indicates that you actually
> > mean that this can't be done in Delphi?)

> Yes, it was a joke.  I thought it would be clearly a joke to
> even slightly experienced Delphi users.  I'm sorry if it wasn't
> clear.  Of course, it would be nice if he went back to his
> teacher and said that it couldn't be done in Delphi.

Re:for all you brains this should be real easy please help


Dodgy argument "As if you could do anything in VB that you can't do easier
in Delphi!" - maybe you can do anything in Delphi... but not necessarily and
always easier!

--
Cheers

Starb

* ----------------------------------------------------------------*
* Lo fa, ne-ko shi-ma de vaja blade Bladerunner *
* ----------------------------------------------------------------*
*        Hey, want a Mac accounts package?        *
*  Then why not visit www.astraaccounts.co.uk  *
*   and download your free copy of Astra now.  *

Quote
"Gurble" <gurbleREM...@THISclear.net.nz> wrote in message

news:k5ucftggpt4vpa8933bh0p3ddr154f9a0h@4ax.com...
Quote

> On Sun, 06 May 2001 21:44:31 -0400, Jud McCranie
> <jud.mccra...@mindspring.com> wrote:

> >It can't be done in Delphi.  Try Visual Basic or C++.

> Huh? It would be easy. No-one's prepared to do it for the kid, because
> it's obviously a school assignment, and he's cross-posted it to most
> Delphi ng's.

> As if you could do anything in VB that you can't do easier in Delphi!

Re:for all you brains this should be real easy please help


It is deprecated in Java Basic++ as well... (at least after version
0.u.r.2.lazy)
Quote
Jud McCranie wrote:

> "Philippa" <phillipagla...@hotmail.com> wrote:

> >1. Write a Program that receives an integer value from the user that
> >represents a number of seconds.If the user clicks on the convert button,the
> >input is converted to the format hours:minutes:seconds .If the user enters
> >40 seconds into the editbox for eg, the result 00:00:40 must be displayed.If
> >the user enters 40 000seconds the result should be 11:06:40. Note that if
> >the resulting number of hours, minutes or seconds is less than 10,it should
> >be preceded by a 0.

> It can't be done in Delphi.  Try Visual Basic or C++.

Other Threads