Space monsters are attacking the Earth, and a giant monster slug-a-thon is imminent. Only Godzilla and Mothra can protect the Earth from this...
Question

Using python, this for a 100 level computer science class so please include docstring; Explanations of code would be appreciated. Linked below is the queue. Read the question carefully and let me know if you have any questions. All the information for the question is given and no information is missing. Good luck, and Thank you !!

Queue:

Image transcriptions

Space monsters are attacking the Earth, and a giant monster slug-a-thon is imminent. Only Godzilla and Mothra can protect the Earth from this invasion! Problem Description In this problem, monsters are arriving to a battlefield one-at-a-time. The input for this problem will consist of of a text file indicating the order in which the monsters arrive. Each line of the file consists of a single monster's name. It might look like this: Gezora Moguera Godzilla Mothra In general, the monster names could be anything, but two names are of special significance: Godzilla and Mothra. All other names are for space monsters. A name could occur more than once, and the names Godzilla and Mothra in particular will very likely occur many times. To simulate the battle, your program should keep track of the order in which the space monsters arrive. Whenever either Godzilla or Mothra arrives, they will defeat whichever space monster is currently first in line. If Godzilla or Mothra arrive when there are no space monsters waiting. nothing happens for now. Two end results of this battle are possible: . The space monsters lose if all of the space monsters are defeated. In this case, your program should print out the names of all of the space monsters that were defeated by each of Godzilla and Mothra. . The space monsters win. This happens if there is at least one space monster who is not defeated by Godzilla or Mothra. In this case, the program should print out the name of the space monster who is currently first in line. Implementation This is a problem where a Queue data structure can be very useful. A simple implementation of the Queue ADT is provided on the course website. Your program must make effective use of the Queue ADT as part of your approach to solving this problem. Sample Output Some sample input files are provided on the course website. For monsters1 . txt, your output might look like this:

The space monsters were beaten! Godzilla defeated : Moguera Mothra defeated: Gezora Varan Alternatively, for monsters2. txt, your output might look like this: Oh no! The space monsters won thanks to Mechagodzilla We may test your program win inputs beyond just those given here. What to Hand In A file named a5q2. py with your solution to this problem. It must import the Queue ADT. It is NOT required to hand in the provided Queue file. Be sure to include your name, NSID, student number, course number and instructor name at the top of all documents. Evaluation . 4 marks: The overall outcome is correctly computed (at most 1 mark if a Queue is not used effectively) . 3 marks: The list of defeated monsters is correctly computed for both Godzilla and Mothra . 1 mark: The correct space monster is reported when the space monsters win

`rem 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. 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. 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 adipiscin`
Step-by-step explanation

itur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem

gue

ec f

gue

et, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque da

`ur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac`

gue

gue

`ec 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. 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. 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 la`

gue

1 Attachment
png