The assumption here is that the cylinder's height is the same as its diameter
h = d
The formula for the volume of a cylinder is:
r2 * π * h
Since 2r = d and h = d we can substitute h with 2r:
r2 * π * 2r
Now we can add the 30 cm3 to the equation and solve for r:
r2 * π * 2r = 30 | /π
r2 * 2r = 30 / π | simplify on the left
2r3 = 30 / π | /2
r3 = 30 / 2π
r = 3√(30 / 2π)
r = 1.6838
Now for the sphere. The formula for the volume of a sphere is:
v = 4/3 * π * r3
Substitute r with 1.6838 and solve:
v = 4/3 * π * 1.68383
v = 20