@Wilksey actually not very much, at school we never covered it (at electronics school! ).
Your program should follow this very simple structure (basically a state machine):
1. Read the port bits associated with I1 and I2.
2. Read the current values of the output port bits associated with Q1 and Q2.
3. Check the values of I1, I2, Q1, and Q2 you just read, and set the output ports for Q1 and Q2 to the their new values according to your truth table. (See below for more detail)
4. Continue and with step #1. Rinse and repeat (essentially what is being called a polling loop)...
How would you check the I1, I2, Q1, Q2?
Note that I1, I2, Q1, Q2 are essentially 4 bits - you could see them as a 4-bit number.
So you could create an array in your program with 16 values (a 4-bit number can have 16 distinct values: 0...15).
The index of the array would be the 4-bit number formed by I1,I2,Q1,Q2.
The value at a particular array position would be the two new bits/values for Q1 and Q2.
From your truth table, the array could look like this (in binary notation, with bit 1 being the new value for Q1 and bit 0 being the new value for Q2):
[b00, b01, b00, b11, b01, b00, ... and so on]
The array index would be formed from the bit values read from the respective input/output ports for I1, I2, Q1 and Q2:
index = (I1 << 3) & (I2 << 2) & (Q1 << 1) & Q2
P.S.: If you write code, it is advised you document it properly. Otherwise you will forget over a few weeks time how your own code works