Question
Having some trouble, need help: Create a program that will do one of two functions using a menu, like so in c++ 1. Do Catalan
Having some trouble, need help:
Create a program that will do one of two functions using a menu, like so in c++
1. Do Catalan numbers
2. Do Fibonacci numbers (recursive)
0. Quit
Enter selection: 1
Enter Catalan number to calculate: 3
Catalan number at 3 is 5
1. Do Catalan numbers
2. Do Fibonacci numbers (recursive)
0. Quit
Enter selection: 2
Enter Fibonacci number to calculate: 6
Fibonacci number 6 is 8
In C++, Create a function of catalan that will take a parameter and return the Catalan number. Also create a function of Fibonacci that will take a parameter, calculate using recursion the Fibonacci number and return the number.
Main will have a do/while loop that will print the menu, enter the selection, and call the functions. Have it quit on 0.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started