Finite State Machine

From Progzoo

(Difference between revisions)
(Created page with "Finite State Machines ==Even Binary Numbers== <question class='P'> <prog> public class EvenBinary { public static void main(String[] args) { String [] ls = {"10", "111", ...")
 
(Even Binary Numbers)
Line 3: Line 3:
  
 
<question class='P'>
 
<question class='P'>
<prog>
+
<prog><![CDATA[
 
public class EvenBinary {
 
public class EvenBinary {
  
Line 48: Line 48:
 
}
 
}
 
}
 
}
</prog>
+
]]></prog>
 
The function '''fact''' takes a single integer input. The result is that number times by each of the numbers smaller - down to one.
 
The function '''fact''' takes a single integer input. The result is that number times by each of the numbers smaller - down to one.
 
  fact(1) =  1        =  1
 
  fact(1) =  1        =  1
Line 56: Line 56:
 
  fact(5) =  1*2*3*4*5 = 120
 
  fact(5) =  1*2*3*4*5 = 120
 
  </question>
 
  </question>
 
  
 
==What is the function==
 
==What is the function==

Revision as of 19:20, 16 February 2012

Finite State Machines

Contents

Even Binary Numbers

The function fact takes a single integer input. The result is that number times by each of the numbers smaller - down to one.

fact(1) =   1         =   1
fact(2) =   1*2       =   2
fact(3) =   1*2*3     =   6
fact(4) =   1*2*3*4   =  24
fact(5) =   1*2*3*4*5 = 120

[Font] [Default] [Show] [Resize] [History] [Profile]

What is the function


[Font] [Default] [Show] [Resize] [History] [Profile]


What is the function


[Font] [Default] [Show] [Resize] [History] [Profile]

What is the function


[Font] [Default] [Show] [Resize] [History] [Profile]