Creating an on/off/auto function for irrigation project

Hello, I am currently working on way to use a 4x4 membrane switch to turn my irrigation controller system into three different states. I want the the keypad to be able to select which code will run, (on,off,auto). I have the code developed for the automation side. However I don't understand creating classes, .cpp files or header files. Do I need these to accomplish my goal. Or is there away to do this from #ifdef /#endif statements, and if so how would that be outlined? Will i have to create separate loop and setup function. Currently the automation code runs from one .ino file.

While it’s not the typical application - you can look at state-machines.
However they are probably more relevant to your ‘watering engine’ code.

The on/off/auto functionality could be considered ‘modes’ a higher level of control.

Aside: There are good reasons not to do this in software.
Many commercial solutions provide a 3-way mechanical switch.
1 - use the output of the watering logic. (auto)
2 - enable the water regardless of the logic control (on)
3 - isolate the control completely. (off)

This also allows you to run the output if the controller has failed ,or need to remove/repair the controller - and also may provide for removing input power in the off position.

Quikksilver:
However I don't understand creating classes, .cpp files or header files. Do I need these to accomplish my goal.

C++ classes can help organize code and make it easier to use. Arduino Serial is a class object.
You don't NEED to write a class for what you want, plain old C is more than enough, you shouldn't need to use pointers either.

Or is there away to do this from #ifdef /#endif statements, and if so how would that be outlined? Will i have to create separate loop and setup function. Currently the automation code runs from one .ino file.

A sketch has only one void setup() and only one void loop(). The loop() runs over and over, what you put in it will run over and over.