News:

If this is your first time to visit, you might have to register here before you can post.

Main Menu

programming

Started by carpediem, January 10, 2011, 10:19:40 PM

Previous topic - Next topic

carpediem

^ Java is a statically typed language, while PHP uses dynamic typing.

marvinofthefaintsmile

nalimutan qn magsulat ng PHP...

Hitad

Yup. PHP is interpreted. Mejo interesado na ko sa Java, saka na lang ako mag-aral ulit pag magagamit ko siya, gusto ko sana gumawa ng kahit simple application lang w/ database.
I've just realized na I need to review JavaScript kasi nag Jquery ako agad lol and I'm trying to make my own framework in PHP.
Gusto ko rin kumuha ng short course about Java para pandagdag sa resume. Meron kaya nito sa Tesda?

eLgimiker0

fibonacci logic

X
Input
Temp1=0
Temp2=1
Sum = 0

   X=0; x<=input;x++
   {
      If x<=input then
        {
           Print sum
           Temp1 = temp2
           Temp2 = sum
         }
    }

Tama ba?

Hitad

Quote from: eLgimiker0 on March 17, 2011, 05:55:34 AM
fibonacci logic

X
Input
Temp1=0
Temp2=1
Sum = 0

   X=0; x<=input;x++
   {
      If x<=input then
        {
           Print sum
           Temp1 = temp2
           Temp2 = sum
         }
    }

Tama ba?


parang static yung sum....

carpediem

yup, you need to update sum for each iteration. hindi mo kailangan yung if statement sa loob, since by definition ng looping conditions mo, x is less than or equal to input.

eLgimiker0

Quote from: eLgimiker0 on March 17, 2011, 05:55:34 AM
fibonacci logic

X
Input
Temp1=0
Temp2=1
Sum = 0

   X=0; x<=input;x++
   {
     
       
           Print sum
           Sum = temp1 + temp2
           Temp1 = temp2
           Temp2 = sum
         
    }

Tama ba?



carpediem

^ may mali :)

fib(0) = 0, fib(1) = 1, fib(2) = 1, fib(3) = 2, fib(4) = 3, fib(5) = 5, .....

try mo implement sa actual code yung sayo, and makikita mo walang output yung fib(0) mo, and yung sequence mo is 1,2,3,5, ....

Hitad

anong language yan? or baka pseudocode lang? Ma-try nga rin yang Fibonacci sequence 4 years ago ko pa yan ngawa lol. Try niyo rin bubble sort :P

carpediem

try nyo both iterative and recursive implementation

Hitad

^
Hindi ko na matandaan yang methods na yan :/


but anyway. Here's my pseudocode for the fibonacci ek ek.. :D

------

var input = 5;
var first = 0;
var second = 1;

var seq = NULL;     //Sequence

for var x=0; x<input; x++
{
     print first;
     seq = first + second;
     first = second;
     second = seq;
 
}



carpediem

^ good. try to implement a function instead of a program

that's iterative. recursion is when a function calls itself

Hitad

^
haha ganun ba. So vocabulary ko lang pala ang sablay  :P

eLgimiker0

hingi sana ako ng guidelines and advice sa paggawa ng portfolio

yes, naka pagresearch na din ako sa google.

pero since maraming magagaling na programmer dito, hingi ako ng advice.. thanks :)

carpediem

^ portfolio? you mean resume or CV?