I kept this problem on 'subscription', as I was hopeful of coming up with a grade 9 solution using Pythagoras.
Here it is.
Set up a spreadsheet with 'w' as a variable.
use formulas to compute
y = root(30*30 - w*w)
x = root(40*40-y*y)
z = root(50*50-x*x)
Compute w + x - y - z. For a square this value should be zero.
Use goal seek to 'find' a value of zero by varying w.
The screen shot from Excel shows the formula set up and the goal seek command with the finished values.
I have used goal seek with this age of child so I think it is a valid method.
Sorry it has taken so long to dream it up.
You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei