Question: Python program:Write a function microcar which accepts two inputs. The two inputs are two lists of strings containing names of CSV files the first list

Python program:Write a function microcar which accepts two inputs. The two inputs are two lists of strings containing names of CSV files the first list contains the names of the files containing the instructions for each microcar and, the second list contains the names of the files containing the actual actions of each care corresponding to the instructions provided to them.

The two csv files will contain lines in the following format: Action, time, speed - where each action will be specified as:

N, t, s = Move North for t seconds with speed s meters per second

E, t, s = Move East for t seconds with speed s meters per second

W, t, s = Move West for t seconds with speed s meters per second

S, t, s = Move South for t seconds with speed s meters per second

The function will return six numpy arrays:

The expected horizontal displacements for each microcar

The expected vertical displacements for each microcar

The actual horizontal displacements for each microcar

The actual vertical displacements for each microcar

The expected distances traveled by each microcar

The actual distances traveled by each microcar

All displacements and distances are to be presented in meters and rounded to 2 decimal places for the final returned lists. Keep the data rounded to at least 10 decimal places for all intermediate computations.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!