1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
marta [7]
3 years ago
7

Complete the following Programming Assignment using Recursion. Use good programming style and all the concepts previously covere

d. Submit the .java files electronically through Canvas by the above due date (In a zip file). This also includes: Requirements (for this problem), Pseudo-Code, UML, Java Doc(s) and an explanation, etc., which must be in the correct format. 9. Ackermann's Function Ackermann's function is a recursive mathematical algorithm that can be used to test how well a computer performs recursion. Write a method ackermann(m, n), which solves Ackermann's function. Use the following logic in your method: If m=0 then return n +1 If n = 0 then return ackermann (m - 1, 1) Otherwise, return ackermann (m - 1, ackermann(m, n - 1)) Test your method in a program that displays the return values of the following method calls: ackermann(0, 0) ackermann (0, 1) ackermann(1, 1) ackermann(1, 2) ackermann(1, 3) ackermann(2, 2) ackermann(3, 2)
Computers and Technology
1 answer:
Likurg_2 [28]3 years ago
6 0

Answer:

Explanation:

public class Ackermann {

   public static int ackermann's(int m, int n) {

       if (m == 0) {

           return n + 1;

       } else if (n == 0) {

           return ackermann's(m-1, 1);

       } else {

           return ackermann(m - 1, ackermann(m, n - 1));

       }

   }

   public static void main(String[] args) {

       System.out.println(ackermann(0, 0));

       System.out.println(ackermann(0, 1));

       System.out.println(ackermann(1, 1));

       System.out.println(ackermann(1, 2));

       System.out.println(ackermann(1, 3));

       System.out.println(ackermann(2, 2));

       System.out.println(ackermann(3, 2));

   }

}

1

2

3

4

5

6

7

29

Process finished with exit code 0

You might be interested in
What is also known as a visual aid in a presentation?
kap26 [50]

Answer:

Option D i.e., slide are the correct option.

Explanation:

The following option is true because in the PowerPoint presentation slide is the visual aid. With the help of the visual aid, the user can add the acumen to its PowerPoint presentation and it is the item in which the user can summarize their information and data that is slide. It is important for the creation of the official or the business purpose presentation.

3 0
4 years ago
Read 2 more answers
I want to know all the part of computer system
Effectus [21]
There are alot of parts in a computer system. You have to be a little specific
4 0
3 years ago
How does an operating system manage peripheral devices?
azamat

Answer:

Device management controls peripheral devices by sending them commands in their proprietary machine language. The software routine that deals with each device is called a "driver," and the OS requires drivers for each of the peripherals attached to the computer.

Explanation:

4 0
3 years ago
What is java programing <br>​
sesenic [268]

Answer:

Explanation:

Java is a class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible. ... Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of the underlying computer architecture

8 0
3 years ago
Read 2 more answers
SHOW ALL YOUR WORK. REMEMBER THAT PROGRAM SEGMENTS ARE TO BE WRITTEN IN JAVA
Aleks [24]

Answer:

im pretty sure that i don't know  the answer

Explanation:

8 0
2 years ago
Other questions:
  • In one to two sentences, explain how to save a new document.
    15·2 answers
  • What does this mean?
    11·2 answers
  • Which type of attack broadcasts a network request to multiple computers but changes the address from which the request came to t
    11·1 answer
  • NEED HELP WILL MARK BRAINLIEST AND 100 POINTS FOR ANSWER Which LIKE operator would match a single character?
    9·2 answers
  • Declare and implement a function called gameOver.gameOver receives a single 3x3 char[] [] array as a parameter, representing a t
    13·1 answer
  • I need help, thank you
    7·1 answer
  • 1.) Explain one way the internet has impacted the way we behave.
    7·2 answers
  • Ok I'm sorry to all those who are trying to messasge me on brainly my brainly inbox is not working and hasn't work since the beg
    12·2 answers
  • PLS ANSWER. MARKING CORRECT ANSWER AS BRAINLIEST
    11·1 answer
  • help this poped up on my pc im on my laptop what does it mean HELP rC % M i \g e - A u t o M e r g e d - b a s e ~ 3 1 b f 3 8 5
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!