Question
Asked by:
$10.00 Java small coding in 2 class: Triangle and TestTriangle
- From Computer-Science: Object-Oriented-Programming
- Closed, but you can still post tutorials
- Due on May. 28, 2008
- Asked on May 22, 2008 at 8:35:31PM
Q:Triangle class
a) Use lengths of sides as attributes. Alternatively use co-ordinates of corners. data types to be used ( String, double, int)
b) Code a constructor that takes three lengths as inputs
c) Code a second constructor that takes one length as input (equilateral).
d) Code a third constructor that has no inputs and sets the lengths as 3,4,5
e) Code methods to get perimeter and get length of sides
f) Code a method to set length of sides
The Triangle class should have a TriangleTest driver class to run it. In this class build at least 3 Triangle objects, one per constructor and run all methods at least once to test that the methods work at least once.



