![]() |
![]() |
Triangles Computer Programming ContestProblem DescriptionCreate a program that reads three integer numbers. Each of these numbers represent one side of a triangle. The program must determine if lines of these three lengths could be used to create a triangle. If a triangle could be created, the program must further determine if that triangle would be an equilateral triangle, an isosceles triangle, a right triangle, or a regular triangle. Assume three lines can make a triangle if the sum of the lengths of the two shorter lines is greater than or equal to the length of the longest line. For example, given lines of length 5, 3, and 7, you could make a triangle. This is because 5 + 3 is greater than 7. However, lines of length 3, 5, and 9 could not make a triangle. This is because 3 + 5 is less than 9. If the lines can make a triangle, determine if the triangle is an equilateral triangle, an isosceles triangle, a right triangle, or a regular triangle. An isosceles triangle is one in which two of the three sides are equal and the conditions above are met. An equilateral triangle is one in which all three sides are equal and the conditions above are met. A right-triangle is one in which the sum of the squares of two sides equals the sum of the square of the third side and the conditions above are met. For example, a triangle with side lengths of 3, 4, and 5 is a right triangle because 32 + 42 = 52. InputThree positive integer values representing the three sides of a triangle will be entered. You do not need to edit to ensure only numbers are entered. You may request the input be entered at one time or use three separate prompts - one for each input value. The values for the line lengths can be entered in any order. For example, you can't assume the longest length will always be entered first. You can't assume the lengths will always be entered in descending or ascending order. Your values may be input as a single set of data or as a grouping of three individual pieces of data. Your application can be created to process a single set of data. That is, after processing a set of data, your application can end. You can then start the application again and enter a second set of data. If you use a graphical interface (Visual Basic, C#, ...) you can enter the data in text boxes and display the results in text boxes or labels. However, a graphical interface is not required for this application. If you create a command line application you can prompt for the input numbers one at a time or enter them all in a single input statement. Sample Input/Output
|
Want more information?Melinda White Get Admissions Info Did you know? |
| Altamonte Springs Campus 850 South State Road 434 Altamonte Springs, FL 32714 | Heathrow Campus 1055 AAA Drive Heathrow, FL 32746 | Oviedo Campus 2505 Lockwood Boulevard Oviedo, FL 32765 | Sanford/Lake Mary Campus 100 Weldon Boulevard Sanford, FL 32773 |
| A Diverse Learning Community...An Equal Access/Equal Opportunity College © Seminole Community College, 1996-2008 Privacy Policy About Us | Contact Us | Site Map | |||