How to model a box with a circular top?
Start with a box and subdivide (W > Subdivide) it to give yourself more geometry to work with.  Then select the corner edges of the side you want to make circular and hit Alt+Shift+S (scale to sphere) and type 1 (to make it scale it 100% to a sphere).  You will then have to scale it in a little (with S) to whatever size you want.  Repeat the process with the lower edge loops and &lt;100% amounts to get a nice smooth interpolation (do it more than I did in the below GIF to get a higher resolution curve).





To get the rounded edges you can use a Bevel modifier with the limit method set to Angle.  Play with the threshold angle and bevel amount to get the desired look you want.