Mechanics - Castle under siege (needs checking)

A castle is under siege. Its walls are 40m high, and it stands on level ground. The besiegers have a cannon at ground level 200m away and aim directly towards the castle and an angle of 35 degrees to the horizontal.

Using the standard equation for path, or working from first principles, find the speed of firing for a cannonball to just clear the top of the wall of the castle and find the time taken?

The defenders also have a cannon placed at the top of the walls, and can only fire this horizontally. Their aim is to either hit the opposing cannon, or to hit the members of the opposing army strung out behind for a distance of a further 200m. What range of values of speeds of firing is appropriate for the defenders’ cannonball?

PS: Air resistance is to be ignored in this question. g=acceleration du to gravity = 10

My answer: please could someone take 5 mins to check all calculations to see if I'm correct, and tell me if I have gone wrong somewhere. Thanks :-)

Right...

Solving forces horizontally:

constant speed of: u.cos alpha

so

x = u.cos alpha.t

**200=u.cos 35. t** (1)

Solving vertically:

a=-g

Initial velocity: u.sin alpha

y = u.t + 1/2 a.t^2

y = u. sin alpha . t - (1/2) g.t^2

**40 = u. sin 35.t - (1/2) (10). t^2** (2)

From (1) we get u = 200 / cos 35.t

replacing in (2) we get:

40 = (200 / cos 35.t) sin 35.t - (1/2) g.t^2

40 = 200.tan 35 - (1/2) g.t^2

(1/2)g.t^2 = 200 tan 35 - 40

5t^2 = 200 tan 35 - 40

t^2 = 40 tan 35 - 8

**t = 4.473 seconds**

As

u = 200 / cos 35.t

u = 200 / cos 35 * 4.473

**u = 54.584 ms-1**