2.4 Lab: Triangles of All Kinds
 Due Jul 10 by 11:59pm
 Points 10
 Submitting a website url
 Available Jul 6 at 12am  Jul 17 at 11:59pm 12 days
Tutorial Video:
In this lab, you will use Boolean operators to determine what sort of triangle a user is describing.
Is that even possible!?

Write a SNAP program that asks the user for the lengths of all three sides of a triangle. Store each length in a separate variable (use the 'Set' block). Then say the perimeter of the triangle with those three side lengths

Add code to your program to check whether or not the three side lengths can form a real triangle. Remember that, in any real triangle, the sum of the lengths of any two sides is greater than the length of the third side. So, if the triangle has side lengths a, b, and c, then all of the following must be true:
a + b > c
a + c > b
b + c > a
If the sides given cannot make a real triangle, say so instead of saying the perimeter.
(Hint: Use the AND operator block)
What kind of triangle?

Add code to your program to determine and say whether or not the triangle described is a right triangle. If the triangle has side lengths a, b, c and, then the triangle is a right triangle if the following is true:
a^{2} + b^{2} = c^{2}

Add code to your program to determine which type of triangle has the side lengths given. A triangle can be one of the following three types:
Triangle type  Description 

Equilateral  All three side lengths equal 
Isosceles  Two side lengths equal, one different 
Scalene  All three side lengths different 
3. Add comments to your program identifying the places where the program correctly meets the requirements of the rubric.
4. BONUS: Modify your code so that a right triangle is recognized regardless of when the hypotenuse value is entered.
 Hint For Checking Your Work! 
Want a quick set of numbers to check the different values, to see if it's all working?
Triangle?  Perimeter?  Type?  
1, 2, 3  NO  N/A  N/A 
2, 2, 1  YES  5  Isosceles 
3, 3, 3  YES  9  Equilateral 
3, 4, 5  YES  12  Right & Scalene 
3, 5, 4  YES  12  Right & Scalene 
7, 8, 9  YES  24  Scalene & NOT Right 
Rubric
Criteria  Ratings  Pts  

The program asks the user for 3 side lengths of a triangle and stores each length in a variable.
threshold:
pts


pts



The program stores the user input in a variable and then says the perimeter of the triangle created with the lengths the user entered.
threshold:
pts


pts



The program checks to make sure the three lengths can form a real triangle.
threshold:
pts


pts



The program correctly recognizes if the triangle is a right triangle, when the hypotenuse is the last number entered.
threshold:
pts


pts



The program correctly identifies equilateral, isosceles, and scalene triangles based on the sides the user input.
threshold:
pts


pts



The code is commented identifying the places where the program correctly meets the requirements of the rubric.
threshold:
pts


pts



BONUS: The script recognizes right triangles regardless of when the hypotenuse is entered.
threshold:
pts


pts



Total Points:
11.0
out of 11.0
