Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is a Python Program. Kindly help .OVERI.APPING PHOTOGRAPHS Write a program, stored in a file named perimeter.py, that performs the ollowing task. Prompts the
This is a Python Program. Kindly help
.OVERI.APPING PHOTOGRAPHS Write a program, stored in a file named perimeter.py, that performs the ollowing task. Prompts the user to input the name of text file asumed to be stored i the working directory. We ssume that if the naune is valid then the file consists of lines all containing integers separated by whitespace, of the form ? yi r2 y2 where (11,p) and (z2,p) are meant to represent the ooor dinates of two opposite corners of a rectangle With the provided file frases 1.trt, the rectangles can be represented as ollows, using fron top bottom the colours green, yellow, red, blue, purple, olive, and magenta. We assune that all rectangles are distinct and either properly overlap or are disjoant (they do not touch each other by sone of their sades or some of their corners) Computes and outputs the perimeter of the boundary, so with the sample file perimeter.py, the sm of the lengths of the (external or inl) saes of the following picture. Here is a sumple run of the program with the two provided sample files python3 perimeter.py Thich data file do you vant to use? franes 1.txt The perineter is: 228 python3 perimeter.py Thich data file do you vant to use? franes 2.txt The perineter in: 9090 .OVERI.APPING PHOTOGRAPHS Write a program, stored in a file named perimeter.py, that performs the ollowing task. Prompts the user to input the name of text file asumed to be stored i the working directory. We ssume that if the naune is valid then the file consists of lines all containing integers separated by whitespace, of the form ? yi r2 y2 where (11,p) and (z2,p) are meant to represent the ooor dinates of two opposite corners of a rectangle With the provided file frases 1.trt, the rectangles can be represented as ollows, using fron top bottom the colours green, yellow, red, blue, purple, olive, and magenta. We assune that all rectangles are distinct and either properly overlap or are disjoant (they do not touch each other by sone of their sades or some of their corners) Computes and outputs the perimeter of the boundary, so with the sample file perimeter.py, the sm of the lengths of the (external or inl) saes of the following picture. Here is a sumple run of the program with the two provided sample files python3 perimeter.py Thich data file do you vant to use? franes 1.txt The perineter is: 228 python3 perimeter.py Thich data file do you vant to use? franes 2.txt The perineter in: 9090Step 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