Look up table, Is this possible?

Hi all,
I am very new to arduino and have a radio project i’m working on. I will have 4 inputs that need to mapped out to output the number in the left column per the Binary code table in the picture. Is this possible and how?
Thanks
Rob

binarycode.JPG

School assignment? Take-home test?

This isn’t hard. There’s probably about a thousand ways of doing it. A lookup table would be totally redundant.

Just a quick and dirty solution

byte fromBits(bool a, bool b, bool c, bool d)
{
return a + b*2 + c*4 + d*8;  
}