Homework 4: Stormtrooper Data
HW 4
Professor HG Locklear
hlocklear@pace.edu
General
• Stormtrooper files are sent via burst transmissions and therefore must be very concise. However, the conciseness of the
file makes them difficult to read and prevents some information from being transmitted.
• We have been tasked by Imperial Headquarters to provide a Python program that will process these files and make them
easier to read for HQ personnel.
• Example file has been provided.
• Our Python program must process a data file and create a console output that is more readable as shown below.
Data File
Console Output
Task
• Create the function reWriteTrooperData that accepts no parameters, reads the data located in the Data file, and prints
to the console the corresponding data in the format shown on Slide 2 for each line in the Data file.
• The Rendezvous Point for all Stormtroopers is at X:10 Y:10 Z:10
• The ‘Distance to Rendezvous’ is the 3D Euclidean distance from the Stormtrooper to the Rendezvous Point.
• You may, if you desire, programmatically manipulate the data in the Data file, in any intermediate way, and create one or
more temporary files to assist you in displaying the correct output.
Testing
Place this code exactly as shown in your program