/* hypot.cpp computes the hypotenuse length of a right triangle,
 *  given the lengths of its two legs.
 *
 * Author: Jeremy D. Frens for Hands On C++ 3e
 * Date: August 2002
 *
 * Specification:
 *   input(keyboard): leg1 and leg2, two double values.
 *   output(screen): hypotenuse, a double value.
 ******************************************************************/

#include <cmath>
#include <iostream>
using namespace std;

int main ()
{

  // Step 1.
  cout << "This program computes the hypotenuse of a right triangle.\n";

  // Step 2.
  cout << "Please enter the lengths of two sides: ";

  // Step 3.
  double leg1, leg2;
  cin >> leg1 >> leg2;

  // Step 4.
  double hypotenuse = sqrt(pow(leg1, 2.0) + pow(leg2, 2.0));

  // Step 5.
  cout << "The length of the hypotenuse is " << hypotenuse << endl;

}

