subject

Assume a class Triangle has been defined. It has three instance data, Point p1, p2, p3. The class also has a constructor that receives the 3 Points and initializes p1, p2, and p3, a toString method that outputs the 3 Points, and a computeSurfaceArea method that calculates the surface area of the Tetrahedron (as an int value). We want to extend this class to represent a 3-dimensional Tetrahedron (the Pyramid with triangle base), which consists of 4 Points. Since the Tetrahedron will consist of in essence, 4 triangles, computeSurfaceArea for the Tetrahedron will compute 4 * the surface area of the Triangle made up of 3 of those 4 Points. Write the Tetrahedron class to handle the difference(s) between a Tetrahedron and the previously defined Triangle. Assume the instance data of Triangle are protected and all methods are public. Also assume that the class Point has a toString method.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
When determining the classification of data, which one of the following is the most important consideration? a. processing systemb. valuec. storage mediad. accessibility
Answers: 2
question
Computers and Technology, 23.06.2019 09:00
Which best compares appointments and events in outlook 2010appointments have a subject man, and events do notappointments have a specific date or range of dates, and events do notappointments have a start and end time of day, and events do notappointments have a location option, and events do not
Answers: 2
question
Computers and Technology, 23.06.2019 12:00
If you embed a word table into powerpoint, what happens when you make edits to the embedded data? a. edits made to embedded data change the data in the source file; however, edits made to the source file will not be reflected in the embedded data. b. edits made to embedded data will change the data in the source file, and edits made to the source file will be reflected in the embedded data. c. edits made to embedded data don't change the data in the source file, nor will edits made to the source file be reflected in the embedded data. d. edits made to embedded data don't change the data in the source file; however, edits made to the source file will be reflected in the embedded data.
Answers: 1
question
Computers and Technology, 23.06.2019 19:00
Whose task it is to ensure that the product flows logically from one step to another?
Answers: 3
You know the right answer?
Assume a class Triangle has been defined. It has three instance data, Point p1, p2, p3. The class al...
Questions
question
Mathematics, 01.02.2020 11:43
question
Mathematics, 01.02.2020 11:43
Questions on the website: 13722361