The length of a rectangle is stored in a double variable named length , the width in one named width . Write an expression whose value is the length of the diagonal of the rectangle.
this is what i put: double diagonal=sqrt((length*length)+(width*width));
but its wrong
R.A.K.2012-09-13T08:09:20Z
Favorite Answer
It should be: double diagonal= Math.sqrt((length*length)+(width*width));
A recursive descent parser supplies the shortest and maximum elementary code. you basically would desire to define expressions expression :=: expression operand expression Your application keeps recognizing expressions till it properly-knownshows a term (like "12") and then evaluates up the tree. Algortithms for recursive descent parsers are rather previous (because of the fact the 70's) and are available a great style of languages. between the 1st obtainable e-e book is in Pascal via Niklaus Wirth, the inventor of Pascal. The identify of that e book: courses = Algortithms + records structures. some issues in no way exchange.