summaryrefslogtreecommitdiff
path: root/tests/Factorial.java
diff options
context:
space:
mode:
authorbd-912 <bdunahu@colostate.edu>2024-03-04 22:53:58 -0700
committerbd-912 <bdunahu@colostate.edu>2024-03-04 22:53:58 -0700
commit12f1e24766b061e00663e1934b76f64cd79c8fea (patch)
tree7d7a5343b2a58344770191a954bb2a6e5e05ccc2 /tests/Factorial.java
parenta23fdfa59b8fa2eaf58fbf6d677caf0b6cdf5a31 (diff)
Minimal test suite---failing tests
Diffstat (limited to 'tests/Factorial.java')
-rw-r--r--tests/Factorial.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/Factorial.java b/tests/Factorial.java
new file mode 100644
index 0000000..d938bb6
--- /dev/null
+++ b/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 ;
+ }
+}