For both of these, we will divide the wanted outcome by the number of possible outcomes. We will end up with a decimal. A decimal multiplied by 100 becomes a percent.
[a] 50%
[tex]\displaystyle \frac{\text{wanted outcomes}}{\text{possible outcomes}} =\frac{\text{student failed}}{\text{Period 2's class}} =\frac{12}{24} =0.5,\:0.5*100=50\%[/tex]
[b] 52%
[tex]\displaystyle \frac{\text{wanted outcomes}}{\text{possible outcomes}} =\frac{\text{student failed from Period 3}}{\text{fails from both classes}} =\frac{13}{25} =0.52,[/tex]
[tex]\displaystyle 0.52*100=52\%[/tex]