summaryrefslogtreecommitdiff
path: root/vaporize/tests/Factorial.java
diff options
context:
space:
mode:
authorbd-912 <bdunahu@colostate.edu>2024-03-27 13:09:08 -0600
committerbd-912 <bdunahu@colostate.edu>2024-03-27 13:09:08 -0600
commit8131ddc22af5d39114a55349d71bcdc467599187 (patch)
tree9aaa7b984f223b1b405bb1598982ea992eeba67d /vaporize/tests/Factorial.java
parente8af241aa57104d62c25c8bcbc2df76510998bf9 (diff)
Expand file structure, Vaporize skeleton
Diffstat (limited to 'vaporize/tests/Factorial.java')
-rw-r--r--vaporize/tests/Factorial.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/vaporize/tests/Factorial.java b/vaporize/tests/Factorial.java
new file mode 100644
index 0000000..d938bb6
--- /dev/null
+++ b/vaporize/tests/Factorial.java
@@ -0,0 +1,16 @@
+class Factorial{
+ public static void main(String[] a){
+ System.out.println(new Fac().ComputeFac(10));
+ }
+}
+
+class Fac {
+ public int ComputeFac(int num){
+ int num_aux ;
+ if (num < 1)
+ num_aux = 1 ;
+ else
+ num_aux = num * (this.ComputeFac(num-1)) ;
+ return num_aux ;
+ }
+}