Question: CSC60A Quix Refer to the code segment below that computes the area of the triangle. Read the comments and complete the missing codes in the
CSC60A Quix Refer to the code segment below that computes the area of the triangle. Read the comments and complete the missing codes in the underlined spaces provided Note: The area of triangle- O.5 base height publie class Triangle (a/Declare three instance variables base, height, area of type double public void setTriangle ( (by//This method assigns the parameter base to instance variable base and parameter height to instance variable height public void setTriangle (e)//This method calculates area of triangle 0.5base . height public void display (d)//This methed displays the area of triangle public class TriangleDriver public static void main(Stringll args) (e)/Create an object called TI of Triangle class (D//Call the instance method set Triangle_hase height to set the triangles base as 5.0 and height as (R/Call method area to compute the area of the triangle (h)/Call method to display the area of the triangle
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
