Commit a5133d8

mokha <mokha@cisco.com>
2019-05-04 17:37:18
add problem 6 to README
1 parent faf2692
Changed files (1)
assignments
assignment1
assignments/assignment1/README.md
@@ -131,3 +131,26 @@ Write a program that randomly generates monthly savings amounts for the 15 runne
 Each monthly saving should be in the range of $100 to $800.
 Extend the AddressBook class to store the monthly savings generated by the random number generator.
 Then, display the final account value for each of the 15 runners.
+
+
+6. "The Pythagorean Theorem relates the lengths of the three sides of any right triangle.
+The legs of a right triangle (the two sides of the triangle that meet at the right angle)
+are customarily labelled as having lengths "a" and "b", and the hypotenuse
+(the long side of the triangle, opposite the right angle) is labelled as having length "c".
+The lengths are related by the following equation: a^2 + b^2 = c^2."
+– http://www.purplemath.com/modules/pythagthm.htm
+
+This equation allows you to find the length of a side of a right triangle when they’ve given you the lengths for the other two sides,
+and, going in the other direction, allows you to determine if a triangle is a right triangle when they’ve given you the lengths for all three sides.
+This equation can alternatively be written as c = sqrt of (a^2+b^2).
+You can find the square root of a number by calling the standard function Math.sqrt.
+
+For example, the statement `double y = Math.sqrt(x)` sets `y` to the square root of `x`.
+
+I. Given the right triangles described below, write a program to compute the lengths of the remaining sides using a program.
+a. a=48andc=80
+b. a=84andc=91
+
+II. Determine if the following triangles are right-angled triangles:
+a. a=45,b=55,andc=75
+b. a=28,b=45,andc=53