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
1 bulb controlled by 2-three way switches using 12 volts battery.<br><br> pahelp po
marta [7]

Answer:

Ok so what I can do for this question

5 0
3 years ago
Code written by computer programmers is translated to binary code, so computers can understand the instructions. True or False
san4es73 [151]

Answer:

True

Explanation:

High-level languages such as Java, C++, Ruby, Python, etc need to be translated into binary code so a computer can understand it, compile and execute them.

Machine language is the only language that is directly understood by the computer because it is written in binary code. But writing codes in Machine Language is tiring, tedious, and obsolete as no one really uses it anymore.

7 0
3 years ago
Which device is connected to a port on a switch in order to receive network traffic?
inysia [295]

Answer:

"Passive IDS" is the appropriate answer.

Explanation:

  • A framework that is designed mostly for monitoring and analyzing internet traffic operations and alerting a user or administrator about possible bugs, as well as disruptions, is known to be passive IDS.
  • This IDS cannot carry out certain preventive as well as remedial processes as well as operations by itself.
6 0
3 years ago
3.1.14 Wormhole CodeHS <br><br> May I have it in a copy and paste, please?
Sauron [17]

Answer:

3.1.14 Wormhole CodeHS

Explanation:

3.1.14 Wormhole CodeHS

6 0
3 years ago
Here are a list of attributes that either belong to user model or system model. Please identify which attribute(s) belong to use
OverLord2011 [107]

Answer:

Explanation:

Before answering this question we need to first know the differences between System Mode and User Mode.

System Mode mainly runs code and at the same time overlooking the user's privileges and permissions.

the attribute(s) that belongs to the user model includes:

User Mode

  1. User programs typically execute in this mode
  2. Less-privilege mode

while the attribute(s) that belongs to the system model includes:

System Mode

  1. Also referred to as control mode or kernel mode
  2. Kernel of the operating system
  3. More-privilege mode

8 0
3 years ago
Other questions:
  • Define the method object inc_num_kids() for PersonInfo. inc_num_kids increments the member data num_kids.Sample output for the g
    11·1 answer
  • Your dive computer indicates you need to make a mandatory decompression stop. You buddy's dive computer does not. You should: A.
    9·1 answer
  • The technology Herman Hollerith created in the 1880s began the modern-day data processing function in computers.
    9·1 answer
  • For connection to place on any network you must have a set of standards?<br> O True<br> O False
    8·1 answer
  • ________ is/are used to temporarily hold small units of program instructions and data immediately before, during, and after exec
    11·1 answer
  • Which device uses radio waves? ceiling fan microwave oven air conditioner x-ray machine?
    7·1 answer
  • A free Linux forensics tool
    7·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    7·1 answer
  • 1.in 3 sentences explain briefly what are the examples of the advantage of using multimedia approach in a slide presentation bra
    8·1 answer
  • Which new development in malware caused sandbox technology to automate and introduce artificial intelligence learning
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!