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
write code to print out all combinations of pairs of numbers 1 through m and 1 through n, separated by a comma
Julli [10]

Answer:

bsnsj jsjs ieisis ieies ejsiis ejsiiw ejieis uruen

Explanation:

bsjsjs sjeisibeieie 388393 wi9q9wnss jsjsjs ejeuisbskwoa

5 0
2 years ago
Task 2
yanalaym [24]

Answer:

If the following answer is helpful please mark as brainliest. This is the answer:

Explanation:

print("What is your name?")

name=input()

print("And where do you live", name)

location=input()

print("I've never been to", location)

5 0
1 year ago
Jazmine just finished setting up an operating system that's designed to work between a VM guest OS and computer hardware. What i
VikaD [51]

The name of the operating system Jazmine is setting up is option A: Client  operating system.

<h3>What  is the operating system running in virtual machines?</h3>

A guest or client operating system is known to be the operating system that one can installed on a virtual machine (VM) or on any kind of partitioned disk.

Hence, the name of the operating system Jazmine is setting up is option A: Client  operating system.

Learn more about operating system from

brainly.com/question/22811693

#SPJ1

3 0
1 year ago
Why can’t I “change the country” on settings??<br> (In this app)
Serjik [45]
I don't think it has an option to change your country. If you'd like to see things in a different language, that's probably a different story.
7 0
3 years ago
categorize each job role as an administrative job or management job auditor director legal secretary payroll clerk etc ​
abruzzese [7]

Explanation:

look after the office jobs

3 0
2 years ago
Other questions:
  • What software is typically used for larger systems?
    11·1 answer
  • A collision volume is called ____
    7·1 answer
  • How to revert a dismissed javascript popup alert box in chrome?
    5·1 answer
  • An Einstein Analytics team wants to create a dashboard that displays values from an external, on-premise Oracle Database. What a
    7·1 answer
  • Systems Software, Inc., is introducing a new piece of sophisticated graphics software. A recently hired writer has been assigned
    8·1 answer
  • What is string literal in Java?
    5·1 answer
  • Your network has been having problems lately when users are participating in video conferences - the video and audio stutters ve
    13·1 answer
  • Why is it easier to spot a syntax error than a logical error?​
    10·2 answers
  • A mesh network topology allows all computers to be directly connected. True or False
    9·1 answer
  • Instructions: Write a program that calculates the amount of ingredients needed for various flavors of cheesecake.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!