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...
This question has been answered
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 !!


16932453

16932457


Queue:

queu pt 1.png

https://drive.google.com/file/d/1hhU-dkDW_32A3Zj_tWXA-L0KRBY1mg9Q/view?usp=sharing


https://drive.google.com/file/d/1hhU-dkDW_32A3Zj_tWXA-L0KRBY1mg9Q/view?usp=sharing

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

Answered by Expert Tutors
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

16950257
fficitur laoreet. Nam

1 Attachment
image.png
png
The student who asked this found it Helpful
Overall rating 100%

"Amazing, thank you so much !"

Other answer

ur laoreet. Nam risus ante, dapibus a m

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
Step-by-step explanation

m ipsum dolor sit am
icitur lao
e vel laoreet ac, dictum vitae odio.
amet, consectetur adipisc

cing elit. Nam lacinia pulvinar tortor
m ipsum dolor sit amet, consectet
ipsum dolor sit amet, consectetur a
, dictum vitae odio. Donec aliquet

sus ante, dapibus
molestie consequat, ul
icitur laoreet. Nam
molestie consequat, ul
fficitur laoreet. Nam
e vel laoreet ac, dict
trices ac magna. Fu

Fusce dui lectus, congue vel laoreet
m risus ante, dapibus a molestie conse
nec facilisis. Pellentesque da
gue vel laoreet ac, dictum vitae odio. Donec aliquet
trices ac magna. Fusce dui lectus, congue vel laoreet
nec facilisis. Pellentesque dapibus efficitur laoree
Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem
ongue vel laoreet ac, dictum vitae odio. Donec aliqu
ia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam
usce dui lectus, congue vel laoreet ac, dictum

m risus ante, dapibus
iscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellen
rem ipsum dolor sit


entesque dapibus efficitur
usce dui lectus, congue vel
facilisis. Pellentesque dapibus efficitur lao
lestie consequat, ultrices ac magna. Fusce dui
sus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui
a molestie consequat, ultrices ac

consectetur adipiscing elit. Nam lacini
congue vel laoreet ac, dictum vitae odio. Donec aliquet
facilisis. Pellentesque dapibus efficitur laoreet. Na
ur laoreet. Nam risus ante, dapibus a molestie consequat,
lestie consequat, ultrices ac magna. Fusce dui lectus,
iscing elit. Nam lacinia pulvinar tortor nec facilisis. Pe


risus ante, dapibus a moles
m ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar
facilisis. Pellentesque dapibus efficitur lao
, ultrices ac magna. Fusce dui lectus, congue v
et, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilis
ia pulvinar tortor nec facilisis. Pel
e vel laoreet ac, dictum vitae odio. Donec al
ultrices ac magna. Fusce dui lectus
ipiscing elit. Nam lacinia pulvinar tortor

consectetur adipiscing elit. Nam lacini
iscing elit. Nam lacinia pulvinar tortor nec facilisis. Pe
llentesque dapibus efficitur laoreet. Nam risus ante, dapibus
ongue vel laoreet ac, dictum vitae odio. Donec aliquet. Lore
, ultrices ac magna. Fusce dui lectus,


congue vel laoreet ac, di
ac, dictum vitae odio. Donec aliquet. Lor
facilisis. Pellentesque dapibus efficitur lao
, dictum vitae odio. Donec alique
ipiscing elit. Nam lacinia pulvinar tor
et, consectetur adipiscing elit. Na
sus ante, dapibus a molestie consequa
iscing elit. Nam lacinia pulvinar
o. Donec aliquet. Lorem ipsum dolor sit amet, consectet
Donec aliquet. Lorem ipsum dolor sit amet, consecte

facilisis. Pellentesque dapibus
nec facilisis. Pellentesque dapib
a. Fusce dui lectus, congue vel laoreet ac, dictum vi
ce dui lectus, congue vel laoreet ac, dict
o. Donec aliquet. Lorem ipsum dolor sit amet, consectet

molestie consequat, ultrices ac m
iscing elit. Nam lacinia pulvinar tortor nec facilisis. Pe

amet, consectetur adipiscing el
pulvinar tortor nec facilisis. Pellentesque da
, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec
rem ipsum dolor sit amet, consectetur adipiscing elit. Nam lac
or nec facilisis. Pellentesque dapibus efficitur laoreet. Nam
acinia pulvinar tortor nec facilisis. Pellentesque dapibus eff
iscing elit. Nam lacinia pulvinar tortor nec
facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a mol
trices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae
ctum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectet
onec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit


iscing elit. Nam lacinia pulvinar
a. Fusce dui lectus, congue vel laoreet ac,
a. Fusce dui lectus, congue vel laoreet ac, di
risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui le
congue vel laoreet ac, dictum vitae odio
icitur laoreet. Nam risus ante, dap
ur laoreet. Nam risus ante, dapibus a m
, consectetur adipiscing elit. Nam lacin
rem ipsum dolor sit amet, consectetur
Donec aliquet. Lorem ipsum dolor sit
a molestie consequat, ultrices ac magna
rem ipsum dolor sit amet, consectetur
sus ante, dapibus a molestie consequat,
itur laoreet. Nam risus ante, dapibus a molesti
fficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac
onec aliquet. Lorem ipsum dolor sit amet, consectetur adipi
e vel laoreet ac, dictum vitae odio. Donec a
onec aliquet. Lorem ipsum dolor sit amet, consectetur a

Fusce dui lectus, congue vel laoreet ac
tesque dapibus efficitur laoreet. Nam risus ante, dapibus a mo
, consectetur adipiscing elit. Nam lacinia pulvinar
consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque
ctum vitae odio. Donec aliquet. Lo
iscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus effici

or nec facilisis. Pellentesque dapibus efficitur laoreet. Na
ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor
acinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet.
molestie consequat, ultrices ac magna. Fusce dui lectus, co
ctum vitae odio. Donec aliquet. Lorem ipsum dolor sit ame
facilisis. Pellentesque dapibus efficitur laoreet. Na
nec facilisis. Pellentesque dapibus efficitur laoreet. N
ng elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus effici
ipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesq
Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ip
ec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar
ctum vitae odio. Donec aliquet. Lo
sum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec fac
nec facilisis. Pellentesque dapibus efficitur laoreet. N
m ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar
ipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesq
fficitur laoreet. Nam risus ante, dapibus a molestie conseq

or nec facilisis. Pellentesque dapibus efficitur laore

congue vel laoreet ac, dictum vitae odio
ec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ant
dictum vitae odio. Donec aliquet. Lo
o. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adip

, dictum vitae odio. Donec aliquet. Lorem ip
, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum v
dictum vitae odio. Donec aliquet. Lo
onec aliquet. Lorem ipsum dolor sit amet
amet, consectetur adipiscing elit. N

icitur laoreet. Nam risus ante, dapibus a
, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit a
fficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna.

lestie consequat, ultrices ac mag
ongue vel laoreet ac, dictum vitae odio. Donec aliq
ipiscing elit. Nam lacinia pulvinar tortor nec facilisis. P
sus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel la
usce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ip

sum dolor sit amet, consectetur
m ipsum dolor sit amet, consectetur a
llentesque dapibus efficitur laoreet. Nam risus
ur laoreet. Nam risus ante, dapibus a mo
Fusce dui lectus, congue vel laoreet ac, dictum

ur laoreet. Nam risus ante, dap
ce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec
ec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante,
risus ante, dapibus a molestie conse
facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante,

a. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio
consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellente
m ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia
, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac,
icitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus,

acinia pulvinar tortor nec facilisis. Pellentesque dapibus eff
ctum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Na
gue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum
congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lo
rem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis.

The student who asked this found it Unhelpful
Overall rating 0%
Get unstuck

430,695 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