Question
The point class will create a point object when given 2 values. These will be stored in the attributes named x and y. There will
The point class will create a point object when given 2 values. These will be stored in the attributes named x and y. There will be two methods: getX and getY. There will be no setters; points will only be created with a constructor that receives an x and a y value.
The triangle class will create a triangle object when given 3 point objects. Its attributes will be these three points, which can be retrieved with the getter getVertices, which will return a list of three points. It will also, within the constructor, determine the three side lengths and store those as side1, side2, and side3. (This means that the method sideLength can be in the constructor.) These values can be retrieved with the getter getSides, which will return a list of the three floats.
The triangle class will also include **ALL** of these methods, with the appropriate return value:
duplicatePts boolean
collinear boolean
findShortest float
perimeter float
area float
right boolean
acute boolean
obtuse boolean
scalene boolean
isosceles boolean
equilateral boolean
The triangle objects which are created with be put into a list named myTriangles.
Once you have created the entire list (in other words, not as you create each triangle), you will first check to see if it is a legal triangle (are there duplicate or collinear points). If it is illegal, delete that triangle from the list and report the deletion to an output file. (Give the vertices and the reason either duplicate points or collinear points.)
The list now contains only valid triangles. Go through the list and, for each triangle, report the same information as was required in Program 4 to the output file, following the same formatting requirements as in Program 4.
There will need to be three files submitted: XXmain.py, XXpoints.py and XXtriangles.py
The input file will be named input6.txt and will have the same format as input4.txt
Your output file will be named XXoutput6.txt
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started