Making a on/off/restart button or switch

I am having trouble finding guidance on google to do the following. Any help would be great.

On Off switch both for power and program restart

You are not giving us enough information.

What harware do you have?

What is this going to be used for?

What have you done so far on this project?

What is your background?

.

I have a background with electronics and basic C++. Completed my C++ 145 class.

I have the Mega and uno. In terms of switches and hardware I can acquire as needed.
I have access to a lot of analog and digital electronic components.

The I still need to get approval for my overall project but this is one of baseline requirement for my final project.

So my goal is to research how to do this before it becomes time to start building my final.

I might need more certification but this is the only information I have for this requirement.
"On Off switch both for power and program restart (cannot be the reset on the board)"
He might be referring to just using a button to activate the resetset pin.

Sounds like a very 'dumb' kind of exercise to me.

The on/off for the power is just a power switch.

The program restart is a reset of the hardware. The reset pin needs to be pulled low and then released, just look at the circuit for any arduino board.

Might be the case but all 3 it sounds like need to be a single switch to me unless I am miss reading it.

I was thinking of maybe a 3 position switch. I might need to get additional information of this requirement for the project.

Not clear from the requirements that it needs to be one switch. Maybe the req is vague so that you ask questions of whoever is setting this exercise. It’s the same with real customers, so maybe that is the real learning here?

grio:
I am having trouble finding guidance on google to do the following. Any help would be great.
On Off switch both for power and program restart

I have seen this question before, usually phrased as "how can I reset my sketch into its starting state".

The answer is that you can't. What you need to do is write a sketch where the "reset back to my stating state" is part of its functionality. A lump of code, somewhere, which under certain conditions (eg: a button press) zeros out whatever variables need to be zeroed out.

PaulMurrayCbr:
I have seen this question before, usually phrased as "how can I reset my sketch into its starting state".

The answer is that you can't. What you need to do is write a sketch where the "reset back to my stating state" is part of its functionality. A lump of code, somewhere, which under certain conditions (eg: a button press) zeros out whatever variables need to be zeroed out.

Unsure if you didn't read the thread.

From what I am aware the reset button clears all programmed variables and restarts the program from the very beginning and restarts the currently loaded code from the very beginning.

On Off switch both for power and program restart

What is the problem ?

Power the Arduino from an external source and connect it via a switch

There you are. An On Off switch both for power and program restart