In this experiment, you use the LM2940 with an output voltage Vout = 5 V. With a Drop-Out voltage VDO = 0,5 V this means, that already at an input voltage Vin = 5,5 V the LM2940 provides a stable output voltage!
The LM2940 has the same assignment of the pins as the 78xx...
For the voltage regulator to find its output voltage, the capacitor C1 needs to be included in the circuit. The capacity should in any case be larger than 22 μF.
But what about the heat generated by the LDO voltage regulator...?