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
Which version of Windows was considered an operating environment rather than an operating system? Windows 1.0 Windows 3.0 Window
Goryan [66]
<span>1.0 Windows was considered an operating environment not an operating system</span><span />
6 0
3 years ago
The names of the governing body or organizationds that creates rules for information technology and information communication te
IceJOKER [234]

Answer:

Alliance for Telecommunications Industry Solutions

Explanation:

Alliance for Telecommunications Industry Solutions  is the main body that creates rules for information technology and information communication technology.

This agency create solutions to supports the release of new products and services into the communications marketplace. It also act as an agency that standardizes the  wireless and wireline networks activities. It is accredited by the American National Standards Institute (ANSI).

5 0
3 years ago
Is there an air flow through the house? if so, does the air flow in the window and out the chimney, or in the chimney and out th
soldier1979 [14.2K]

The correct explanation is option B. The pressure is reduced at the chimney due to the movement of the wind above. Thus, the air will flow in the window and out the chimney.

<h3>What is the main purpose of chimney?</h3>

The primary work of the chimney is to show the way that the smoke need to take away from the stove and also out of the house.

Hence, The correct explanation is option B. The pressure is reduced at the chimney due to the movement of the wind above. Thus, the air will flow in the window and out the chimney.

Learn more about chimney from

brainly.com/question/24792291

#SPJ1

See full question below

Is there an air flow through the house? If so, does the air flow in the window and out the chimney, or in the chimney and out the window? Choose the correct explanations.

A. The pressure is increased at the chimney due to the movement of the wind above. Thus, the air will flow in the chimney and out the window.

B. The pressure is reduced at the chimney due to the movement of the wind above. Thus, the air will flow in the window and out the chimney.

C. The pressure is increased at the chimney due to the movement of the wind above. Thus, the air will flow in the window and out the chimney.

D. The pressure is reduced at the chimney due to the movement of the wind above. Thus, the air will flow in the chimney and out the window.

E. The pressures at the chimney and the window are the same. Thus, the air will not flow.

5 0
1 year ago
Could I use a prepaid card to buy a Brainly membership because I tried to get the trial with a low balance but more than like 5$
EleoNora [17]

Answer:

hey mate !

Explanation:

I think you should ask to brainly itself .....or maybe use it without subscription.... And maybe that would help : )

8 0
2 years ago
Fact Pattern: A sales transaction record designed to contain the information presented below. Column Information 1-10 Customer a
ozzi

Answer:

The answer is field check.

Explanation:

The sales transaction record was designed to enter information by range, so the data validation is oriented for range validation and not for a specific logic. In other words, the transaction will check if the information is in a valid range and not if the information is logically valid.

4 0
2 years ago
Other questions:
  • Which is not an example of a boolean operator?
    6·2 answers
  • What is an example of asynchronous communication
    7·1 answer
  • The ______ is the information center that drivers need to refer to when they're NOT scanning the road.
    13·1 answer
  • To determine the average of a range of numbers, click the ____ in the formula bar, then click average.
    13·1 answer
  • Fred wants to analyze his spending habits of the past few years and has gathered information on the checks he has written from 2
    6·1 answer
  • Which of the following is not an Operating System? Select one:
    13·1 answer
  • Persuasion is when Someone speaks to crowd about love <br>○True<br>○False​
    10·1 answer
  • Write a program that:
    13·1 answer
  • Is it good to work out at the gym one day with hands then the next with feet, then a pattern?
    11·2 answers
  • Pleasee helpppppppppppppppppppppp me!
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!