Question
Could someone please write a UML digram of the method class in this code that look like this: ClassName +attributes -attributes +operations -operations here is
Could someone please write a UML digram of the method class in this code that look like this:
ClassName |
+attributes -attributes |
+operations -operations |
here is an example of one UML that has been done for a previous program
ClassNameHere |
- name : String - phoneNumber : int |
+ PhoneBookEntry() + setName(String) : void + getName(): String + setNumber(int) : void + getNumber() : int |
And there also needs to be a JAVADOCs written too, in word, not generated from java compiler
here is an example of this form the link
http://cf.ppt-online.org/files/slide/q/qSJCLazKPmGo5wl8Q3pdRIBkEtVMn4bseZy10W/slide-14.jpg
Here is the code:
MethodClass.java
public class MethodClass {
public int ackermann(int m,int n){ //if m is 0 if(m==0){ return n+1; } //if n is 0 if(n==0) return ackermann(m-1,1); //if m is not zero and n is also not zero return ackermann(m-1,ackermann(m,n-1)); } }
DemoClass.java
public class DemoClass {
//test method ackermann(int , int) public static void main(String a[]){ MethodClass mc=new MethodClass(); //test with 0,0 input int acc=mc.ackermann(0,0); System.out.println("output with 0,0: "+acc); //test with 0,1 input acc=mc.ackermann(0,1); System.out.println("output with 0,1: "+acc); //test with 1,1 input acc=mc.ackermann(1,1); System.out.println("output with 1,1: "+acc); //test with 1,2 input acc=mc.ackermann(1,2); System.out.println("output with 1,2: "+acc); //test with 1,3 input acc=mc.ackermann(1,3); System.out.println("output with 1,3: "+acc); //test with 2,2 input acc=mc.ackermann(2,2); System.out.println("output with 2,2: "+acc); //test with 3,2 input acc=mc.ackermann(3,2); System.out.println("output with 3,2: "+acc); } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started