For the rectangle question, it sounds like this is basically a 30-60-90 triangle. The way that basically works is that the angle measures to side lengths are in the ratio of:
30 : 60 : 90 = x : 2*x : x*sqrt(3)
In this case, you need to find the length of either AC or BD to find the perimeter. This means that angle ADC = 30 degrees.
Since we know the side opposite the 60 degree angle = 12 ==> 2x = 12 ==> x = 6.
Since x is opposite the 30 degree angle, this means that sides AC & BD each have a length of 6. Therefore, the perimeter of the rectangle = 6+6+12+12 = 30.
===================================================
For the square problem, it's the exact same idea, except that when a diagonal is drawn in a square, the angle measures of the triangle formed are: 45:45:90. In a 45:45:90 triangle, the ration of angle measures to side lengths is:
45 : 45 : 90 = x : x : x*sqrt(2)
Here's, I'm assuming the diagonal has the length of 6*sqrt(3). The diagonal is the side opposite the 90 degree angle.
So, we have: 6*sqrt(3) = x*sqrt(2)
==> x = 6*sqrt(3)/sqrt(2) = Length of ONE side of the square.
To find the perimeter of the square, the answer is then: 4*(6*sqrt(3)/sqrt(2)) = 24*sqrt(3)/sqrt(2).
Assuming I read the question correctly, I think these are the correct answers.