Problem Specification After numerous Godzilla attacks, the city of Tokyo, Japan is testing their new invention, Mechagodzilla. Mechagodzilla's...
This question has been answered
Question

This is using python, for a 100 level computer science class, keep it simple. Please include docstring so I can understand what I am reading. Thank you

pt 1.png

pt 2.png

Image transcriptions

Problem Specification After numerous Godzilla attacks, the city of Tokyo, Japan is testing their new invention, Mechagodzilla. You are tasked with implementing a program to help retrieve Mechagodzilla after successful deployments. Mechagodzilla's movements are controlled by sending a series of inputs, 'N' for north, 'E' for east, 'S' for south, or 'w' for west. If something goes wrong and Mechagodzilla is destroyed, we need to be able to find it for retrieval The question we want to answer: Using a standard Cartesian grid, what are the (x,y) coordinates of Mechagodzilla after it finishes a series of movement inputs? Assume Mechagodzilla always starts at the base coordinates of (0,0). Here are some examples to help clarify: 'NNE': coordinate (1, 2) 'NNEEENNW': coordinate (2. 4) WNENWNSNN': coordinate (-1, 4) EESSENNESE': coordinate (5, -1) "WEENEWE' : coordinate (2. 1) "NWEWWNSWW': coordinate (-4, 1)

You will be given a number of datafiles containing inputs of different lengths. Each file will contain a number of lines. Each line will represent inputs from a deployment. The program you must write will open the file. read each line, and then print the final (x.y) coordinates for that deployment to the console. For example. if a datafile contained the examples above. your program would display (1, 2) 4) (-1, 4) (5, -1) (2, (-4, 1 ) Detailed Example Example File (with only one deployment): NNEEENNW Program Output: (2, 4) Illustration to help visualize path taken: finish . O -2 -2-

Answered by Expert Tutors

ng elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet

s a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Don
Step-by-step explanation

sumsque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

gue

ipsum dolor sit am

16288586

et, consectetur a

ng elit. Nam lacinia pulvinar tortor nec facilisis

gue

s a m

16288598

2 Attachments
1.PNG
PNG
2.PNG
PNG
The student who asked this found it Helpful
Overall rating 100%
Get unstuck

479,698 students got unstuck by Course
Hero in the last week

step by step solutions

Our Expert Tutors provide step by step solutions to help you excel in your courses