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, 22.06.2019 02:00
What is the process in which the software development team compiles information to determine the final product.
Answers: 3
question
Computers and Technology, 22.06.2019 08:10
Technician a says that if a valve is open when a piston rises to the very top of a cylinder, the piston may actually strike the valve head and cause serious engine damage. technician b says if the camshaft is located in the engine block, then the engine is called an overhead valve engine, ohv engine, or an in-block camshaft. who is right? a. b only b. both a and b c. a only d. neither a nor b
Answers: 3
question
Computers and Technology, 23.06.2019 01:00
Let r be a robotic arm with a fixed base and seven links. the last joint of r is a prismatic joint, the other ones are revolute joints. give a set of parameters that determines a placement of r. what is the dimension of the configuration space resulting from your choice of parameters?
Answers: 3
question
Computers and Technology, 23.06.2019 05:00
Which best explains why a digital leader would join a society specializing in technology
Answers: 1
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
History, 02.04.2020 20:46
question
Social Studies, 02.04.2020 20:47
Questions on the website: 13722360