Question: Lab Assignment CS 206 Question You design a class named Triangle. This class needs to have following member variables and member methods Member variable vate

 Lab Assignment CS 206 Question You design a class named Triangle.

Lab Assignment CS 206 Question You design a class named Triangle. This class needs to have following member variables and member methods Member variable vate data field for each side rivate data field for area rivate data field for perimeter vate boolean data field named lid" ublic Triangle0 blic Triangle(double b, double h) (b is the value for one side and h is the value for the height from this side) ethods The accessor and mutator methods for all four data fields method named findArea) that the area of the triangle. public double findArea) method named findPerimeterO that s the perimeter of the triangle. public double findPerimeter) for the above methods, you can choose to either have s or not. method isValidO returns a boolean value. This method checks if the triangle is valid or not. If the triangle is valid, return "true. otherwise, returns false" You need to implement a TriangleDriver class. In this Test class, you need to create two Triangle objects using each constructor. One object is created with sides of 10, 17, and 9. Change the sides value of the object that was created using default constructor. Display both objects' area and perimeter, and if they are valid

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!