Use octave or MATLAB as programs to code. do not use disp ornum2str.
Also, do not use break or continue statements.
In this problem we will investigate recursively computing a general exponential function. For a an integer and n a non negative integer, the exponential function can be defined recursively as for n=0 aan-1 for n > 0 an = Write a program that calls a function get integer to get a value for a and which should • keep prompting the user and giving error messages until an integer is entered • return the resulting value The main program should then call a function get nonnegative integer to get a value for n and which should • keep prompting the user and giving error messages until a non negative integer is entered • return the resulting value The main program should then call a recursive function exponential function which should • take in a value for a and a value for n • call itself recursively as needed to calculate a” according to the formula above • not use the built-in exponential operator“ • return the resulting value The main program should then print the result. Sample output: Enter an integer: 3.5 Invalid entry 3.5 Enter an integer: -2 Enter a nonnegative integer: -4 Invalid entry – 4 Enter a nonnegative integer: 3 The result of -2°3 is – 8 Show transcribed image text In this problem we will investigate recursively computing a general exponential function. For a an integer and n a non negative integer, the exponential function can be defined recursively as for n=0 aan-1 for n > 0 an = Write a program that calls a function get integer to get a value for a and which should • keep prompting the user and giving error messages until an integer is entered • return the resulting value The main program should then call a function get nonnegative integer to get a value for n and which should • keep prompting the user and giving error messages until a non negative integer is entered • return the resulting value The main program should then call a recursive function exponential function which should • take in a value for a and a value for n • call itself recursively as needed to calculate a” according to the formula above • not use the built-in exponential operator“ • return the resulting value The main program should then print the result. Sample output: Enter an integer: 3.5 Invalid entry 3.5 Enter an integer: -2 Enter a nonnegative integer: -4 Invalid entry – 4 Enter a nonnegative integer: 3 The result of -2°3 is – 8
Expert Answer
Answer to Use octave or MATLAB as programs to code. do not use disp or num2str. Also, do not use break or continue statements….