Definition that uses another Function

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.

Answer:

No.

Definition that uses another Function

As long as everything in the definition for Pyramid() is defined someplace, everything is fine. Here (for reference) is Pyramid():

Pyramid(1) = 1
Pyramid(N) = Pyramid(N-1) + Triangle(N)

And here (for review) is Triangle():

Triangle( 1 ) = 1
Triangle( N ) = N + Triangle( N-1 )

Given these two definitions (and, if you are picky, the definitions of addition and subtraction), Pyramid() is completely defined.

QUESTION 5:

Of course, given a definition, creating a Java method is just a matter of translation:

public int Pyramid( int N )
{
  if (  ==    ) 
  
    return    ;
     
  else
  
    return    (   ) +    (    );
}

Fill in the blanks. (You can easily do this with copy-and-paste from the definition of Pyramid.)