How to transform a cube into this
I'd do it backwards:




Create a circle
Use Box Select to delete the lower half of the circle
Select all of them and extrude upward
Flatten the upper half with SY0RETURN (might be another axis for you)
(alternatively just extrude the side verts, select everything and fill the whole thing with F)
Extrude the entire shape to give it depth.


There's another way of doing this....

Take a cube and give it more resolution. Either with a Loop Cut or by subdividing the lower edges.



Then use the Proportial Editing Tool, set the falloff to spherical, select the middle edge and move the mouse up, restricting it to one axis. Doesn't always give a perfect circle though. More like an ellipse.

Luckily there's another way of doing this...

Again use a cube that has enough resolution at the bottom, put a cylinder under it (use one with enough verts, 1024 segments are fine) and use a Cast Modifier on the Cube. Apply the modifier and get rid of the cylinder.