Board index » delphi » Program Help

Program Help

I am looking for a written function that will take the cube root of the
number.

If anyone has it, please post it to my email  dsga...@prodigy.com, or
bluem...@kdcol.com.

Thanks tons.

P.S.,  I don't know if there is a built in fuction for this, if so I'm
not looking for that, but actual code that will do the same thing.  I
have some code that will do the square root, I don't know how to convert
it though.

Thanks tons

 

Re:Program Help


In <45e505$2...@usenetp1.news.prodigy.com> DSGA...@prodigy.com (Jeff

Quote
Bluemel) writes:

>I am looking for a written function that will take the cube root of
the
>number.

>If anyone has it, please post it to my email  dsga...@prodigy.com, or
>bluem...@kdcol.com.

>Thanks tons.

>P.S.,  I don't know if there is a built in fuction for this, if so I'm
>not looking for that, but actual code that will do the same thing.  I
>have some code that will do the square root, I don't know how to
convert
>it though.

>Thanks tons

Try exp((1/3) * ln(YourNumber));

Bob.

Re:Program Help


Hey guyes, I've got a program here I can't figure out.  I will not
calculate the sum after the first number.

Help appreciated...

Program 38;

var Times, Number, OldNumber, Sum, Count : integer ;
Const Zero = 0 ;

        {This program will add positive numbers in sequence that
terminal
        with zero.  The numbers must also be positive}

begin
     OldNumber := 0 ;
     Number    := 0 ;
     Count     := 0 ;
     Sum       := 0 ;
     Times     := 0 ;
     writeln ;
     write   ('Please enter how many number you have to enter = ') ;
     readln  (Times) ;
     for Count := 1 to Times do begin
         write  ('Please enter the value of the number = ') ;
         readln (Number) ;
         if (Number > OldNumber) and (10 mod Number = Zero) then
            Sum := Sum + Number ;
         OldNumber := Number ;
         end; {for}
     writeln ('The sum of the numbers entered = ', Sum) ;
end. {Program 38}

Jeff Bluemel  

Private email prefered
bluem...@kdcol.com or dsga...@prodigy.com

Re:Program Help


Quote
In article <45sjip$...@kdcol.kdcol.com>, bluem...@kdcol.com (Jeff Bluemel) writes:
>Hey guyes, I've got a program here I can't figure out.  I will not
>calculate the sum after the first number.

>Help appreciated...

>Program 38;

>var Times, Number, OldNumber, Sum, Count : integer ;
>Const Zero = 0 ;

>        {This program will add positive numbers in sequence that
>terminal
>        with zero.  The numbers must also be positive}

>begin
>     OldNumber := 0 ;
>     Number    := 0 ;
>     Count     := 0 ;
>     Sum       := 0 ;
>     Times     := 0 ;
>     writeln ;
>     write   ('Please enter how many number you have to enter = ') ;
>     readln  (Times) ;
>     for Count := 1 to Times do begin
>         write  ('Please enter the value of the number = ') ;
>         readln (Number) ;
>         if (Number > OldNumber) and (10 mod Number = Zero) then

             ^^^^^^^^^^^^^^^^^^^
What is the purpose of this condition?

Quote
>            Sum := Sum + Number ;
>         OldNumber := Number ;

Why are we saving the previous number here?

Quote
>         end; {for}
>     writeln ('The sum of the numbers entered = ', Sum) ;
>end. {Program 38}

>Jeff Bluemel  

>Private email prefered
>bluem...@kdcol.com or dsga...@prodigy.com

With certain data sets, these conditions will prevent the program from
seeing some of zero terminated numbers for summing, what data are you
using?

Email me a bit more info please.

Regards,

-* Stephen *-
Stephen Posey
University of New Orleans
Email  : S...@uno.edu
WWW    : http://www.uno.edu/~slp

Other Threads