Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program (stored in the file collision.py) that does the following: Reads in data from the file points1.txt and adds all data into a

Write a program (stored in the file collision.py) that does the following:

image text in transcribed

image text in transcribed

Reads in data from the file points1.txt and adds all data into a Pointset. (Please use 10 rows and 10 columns for your pointset.) Each line contains the y, and feature values for one entry. Reads in data from the file points2.txt, with the same format as points1.txt. (How you want to process/store points2.txt, in a Pointset or otherwise, is up to you.) For each point in points2.txt, determines if there is a point in points 1.txt that occupies the same x, y coordinates (i.e., a 'collision). For each collision print a message on a single line, using the following structure: collision x 4 y 18 where 4 would be the x value of the collision, 18 would be the yvalue of the collision, and there is a single space separating each element after the colon. One line is printed per collision; if there are multiple collisions they should printed be in the same order as encountered in the file points2.txt. If there are no collisions in the file, then a single message should be printed: No collisions

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

Programming The Perl DBI Database Programming With Perl

Authors: Tim Bunce, Alligator Descartes

1st Edition

1565926994, 978-1565926998

More Books

Students also viewed these Databases questions

Question

=+ Is the information source free from bias on the subject?

Answered: 1 week ago

Question

Question What integration level should an employer choose?

Answered: 1 week ago