listing continued static stackx thestackstatic int codepartstatic params theseparams//public static void main(string[argsthrows ioexception system out print("enter number")thenumber getint()rectriangle()system out println("triangle="+theanswer)/end main(//public static void rectriangle(thestack new stackx( )codepart whilestep(=false/call step(until it' true /null statement //public static boolean step(switch(codepartcase /initial call theseparams new params(thenumber )thestack push(theseparams)codepart breakcase /method entry theseparams thestack peek()if(theseparams = /test theanswer codepart /exit else codepart /recursive call breakcase /method call params newparams new params(theseparams )