mzise1:
So wait can this do more than 2 functions if you write a program c? :... snip ...
I wrote the piece of pseudo code that you refer to as an illustration of how to start merging two existing pieces of code. And, of course you could merge as many as you want. It's going to get rather messy however if you have more than two. Perhaps get two working before starting to merge a third.
The example that @BillHo linked to is a better starting point if you want to build your own project. And, in many cases it is easier to start from scratch rather than merge two sketches. Use the existing sketches to learn the technique.
Ideally, when the merging is complete the overall structure will be very like the example.
...R