Question: Instructions Turtle - hit the target Design and write a python program for chapter 3 exercise # 1 9 in your textbook. Refer to your

Instructions
Turtle - hit the target
Design and write a python program for chapter 3 exercise #19 in your textbook.
Refer to your textbook for exercise details.
Click on "lab 3-4" title above to access the provided starter program.
Be sure to use clear prompts/labeling for input and output.
Don't just print a number, you will lose points if you omit output labels and input prompts.
Follow the program coding requirements found in the lab rubric.F B1t the Ta=get Gane
import turtie
Nianad cenatanta
SCREEN_WIDTH -600 Scraen rideh
SCREEN_HEIGHT -600 Scraen he1ghe
ZARGET_ILEFT_X -100 Targat'a loner-left x
ZARGET_IIEFT_Y -250 Target's loner-1eft Y
zargET_WIDTH -25 # Width ef the target
FORCE_FACTOR -30 F handt=a=y force facter
PROJECTILE_gPEED -1 F Frojectile's andnatien speed
NORZa -50 # Angle ef north direction
souza -270 Fingle ef south direction
EASZ -0 F Angla of east direction
MESZ -180, Fingle of mest direction
F Setrp the mindon.
turt1e.aetup{sCREEN_MIDZH, sCREEN_EEICAZ}
Dran the ta=get.
turtie.n1datu=t1e0
turt1e. apead (0)
turtie. panup()
turt1e.gote (TRRGEI_IIEFT_X, TRAGEI_ILEFY_T)
turtie. pendemn ()
turt1e. eatheading {E2sz}
turt1e.fcrma=d (TARGEZ_HIDIH)
turt1e, aetheading (MORa])
turtie. 10=wa=d(TARGEZ_rIDTH)
turtie. aetheading (itesz)
turt1e.fc=ma=d (IXRGEZ_HIDTH)
turtie. aethading (SO07a)
turtie.te=wa=d (TARGEZ_rIDTH)
turtie. panup()
# center the turtie.
turtie.gete (0,0)
turt1e. aetheading {E2sz]
turtie. ahertu=t1e0]
turt1e. apead (PRoJECZTIE_gPEED)
Get the angle and force from the user.
angle - lleat (1nput ("Enter the project11e"s angle: ")}
force - fleat (1nput("Enter the lawneh force (1-10): "})
F Calculate the distance.
dtatance - toace * FORCE_FACTOR.
F Set the headiag.
turtie. aetheading (angle)
F Iaunch the proyectile.
turtie. pendemn ()
turtie. formazd (d1atance)
F Did it hit the target?
11(tu=t1e.xQex 0)- ZARGET_ILEFT_x and
turtle.xCOx0-(ZARGET_LLEFI_x+ ZARGEI_WIDTH) and
tu=tle.yC0=0-(ZARGET_ILERT_+ ZARGEI_WIDTH))=
p=1nt('Ta=geth+-t!')
e18e:
p=1nt("You niesed the ta=get.")
 Instructions Turtle - hit the target Design and write a python

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!