Question: 19. (4 pts). Write Java statements to create a class named Triangle that includes: hree instance variables named a, b, and c, all of type

 19. (4 pts). Write Java statements to create a class named
Triangle that includes: hree instance variables named a, b, and c, all

19. (4 pts). Write Java statements to create a class named Triangle that includes: hree instance variables named a, b, and c, all of type double. These denote the lengths of the sides of the triangle). A constructor that initializes the three instance variables to values specified when cre ating an object of this class (not the default no-arg constructor). The set and ger methods for each of the instance variables. A method named calculateArea that calculates the area of the rectangle. For th purpose, you will use the formula Area = s(8 - a)(s b)(s - c), where s = (a + b + c)/2. You need not write the driver class to test this class. Public class Triangle? double = as double = b; double : Rublic Triangle (double a double to, dow ned Triangle that includes: type double. (These denote the 19. (4 pts). Write Java statements to create a class named Tr o Three instance variables named a, b, and e, all of type doub. lengths of the sides of the triangle). A constructor that initializes the three instance variables to values specine ating an object of this class (not the default no-arg constructor). The set and get methods for each of the instance variables. A method named calculateArea that calculates the area of the rectangle. For this purpose, you will use the formula ables to values specified when cre- Area = s(s - a)(s - b)(s - c), where s = (a + b + c)/2. You need not write the driver class to test this class. Public class Triangle{ double = a; double = b ; double : Public Triangle (double a, double to, double c){

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!