Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with this programming assignment. It is to be done in Python programming language. P.S. Please adhere to all of the detailed requirements

image text in transcribed

I need help with this programming assignment. It is to be done in Python programming language.

P.S. Please adhere to all of the detailed requirements and instructions. Your help will be most appreciated. Thanks

The main program will be named XXProg4.py. The file with the functions will be named XXtriFun.py. (XX, of course, represents your initials.) The list now contains only valid triangles. Go through the list and, for each triangle, if the data is valid, report on the following (see sample below). The output will be printed from the main program, not from within the functions. There will need to be three files submitted: XXmain.py, XXpoints.py and XXlriangles.py (VERY IMPORTANT List the vertices Length of the shortest side (2 decimal places) Perimeter (2 decimal places) Area (2 decimal places) Whether it is right, acute or obtuse Whether it is scalene, isosceles or equilateral (choose one only . . For XXpoints-py and XXtriangles.py use two classes(respectively): 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 INPUT The main program will loop through a data file named input6.txt reading and processing each line of data. The data will be in this format The triangle class will create a triangle object when given 3 point objects. Its attributes will be these three points, which can be of three points. It will also, within the constructor, determine the three side lengths and store those as sidel, 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. retrieved with the " getter" getVertices, which will return a list X1 Y1 X2 Y2X3 Y3 It represents the )coordinates of the three vertices of a triangle, such as these: For each triangle, your program will first check to make sure each point is unique (no duplicates) and that the three points are not collinear 14 2.3 3.2 4.1 5.0 6.9 5 31 3.0 3. 1 OUTPUT ?Use an epsilon of 0.0001 when evaluating features. (VERY IMPORTANT) Your output file will be named XXoutput6.txt, following this format: Vertices: (14, 2.3), 3.2, 4.1), (5.0, 6.9) Shortest side is 255 Perimeter is 11.72 The triangle class will also include "ALL" of these methods, with the appropriate return value: Area is 0.90 Obtuse duplicatePts boolean collinear n indShortest float perimeter float float boolean boolean isosceles bn equilateral bln right acute obtuse 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.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

8) How is an invoice created - sending it to a customer

Answered: 1 week ago