When you write and download a program in this environment you are doing this for one program only. However all that you want to achieve can be done in the one program by having three (or more ) different sections to the program and the appropriate section run depending on your input switches.
All computers run one program per processing core. Most computers have one processing core an look like they are doing several things at once by time division multiplexing, that is they chop what they are running so quickly that it looks like things are running at once.
With processors like the arduino you are running closer to the metal than a desktop but basically it is the same thing.
Hope that helps.