I'm going to only focus on part B
If 'a' and 'b' are rational numbers, then
where p,q,r,s are integers. Also, q and s are nonzero. In fact, this context would make sense to also have p and r to be nonzero as well.
The perimeter of this rectangle is
P = 2*(length+width)
P = 2*(a+b)
P = 2*(p/q + r/s)
P = 2*(ps/qs + qr/qs)
P = 2*( (ps+qr)/qs )
P = (2ps+2qr)/qs
P = integer/integer = some rational number
We see that the perimeter P is rational if and only if 'a' and 'b' are rational.
From this, notice that the area is
area = length*width = a*b = (p/q)*(r/s) = (pr)/(qs)
Showing that the area is also rational.
If we wanted the area to be irrational, then we'd have to have either 'a' and/or 'b' irrational; this would then make the perimeter irrational as well. This contradiction is sufficient to show that case B is not possible.
There is no way to have a rational perimeter but an irrational area.