# Lab1: Calculating the Hypotenuse¶

Note

This project will be graded as a lab, but you are to place it in your homework repository, in a folder named “LAB1”. Future lab work will be in separate repositories.

As a simple check to see if you can put together a basic C++ program. In this lab, you will build a simple program that does the following:

All programs should identify themselves (at least in this class!) Make your program display the following text:

Finding the length of the hypotenuse of a right triangle.


## Ask the User for Input¶

Next, prompt the user to enter two numers. Tell them what to enter with a prompt:

Enter the length of the first side (as a floating point number):


Read the input number and store it in a suitable variable. Prompt the user in a similar way for the second side length.

## Find the Final Length¶

You should know the formula for this part. Set up an expression to evaluate this final value, and store it in a suitable variable.

Note

You will need the sqrt function to get the answer. DO a bit of research on how to access this functon. (Hint: you need another “include” line in your program!)

## Display the Result¶

Finally, output the final result:

The length of the hypotenuse is xxxx.xxxx


## Looping¶

To make this more interesting, wrap all of this (Except the header) in a loop. You will stop the program when the length of the first side is a negative number.

## What to Turn In¶

You will submit all of your work using your GitHub account, placing your project in a folder named “LAB1”. (Remember that for this lab only, you will place this in your homework repository.)

## When is This Due?¶

Unless told otherwise, all labs and homework are due on the Sunday of the week they are assigned.