diff options
author | bd-912 <bdunahu@colostate.edu> | 2024-03-27 13:09:08 -0600 |
---|---|---|
committer | bd-912 <bdunahu@colostate.edu> | 2024-03-27 13:09:08 -0600 |
commit | 8131ddc22af5d39114a55349d71bcdc467599187 (patch) | |
tree | 9aaa7b984f223b1b405bb1598982ea992eeba67d /typecheck/tests/Factorial.java | |
parent | e8af241aa57104d62c25c8bcbc2df76510998bf9 (diff) |
Expand file structure, Vaporize skeleton
Diffstat (limited to 'typecheck/tests/Factorial.java')
-rw-r--r-- | typecheck/tests/Factorial.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/typecheck/tests/Factorial.java b/typecheck/tests/Factorial.java new file mode 100644 index 0000000..d938bb6 --- /dev/null +++ b/typecheck/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 ;
+ }
+}
|