Exercises
Duplicate the rocket program, part a, first output only
Duplicate the rocket program, part b
Draw a square using a black pen (reasonable side length).
Draw a solid red circle that is completely inside the square.
Draw a straight horizontal line through the center of the circle
Rocket program continued
Change the title to Rocket program created by (enter your name)
Using labels and text boxes as appropriate, prompt the user to enter
Ø The flight time
Ø The initial velocity
Ø The launch angle
Draw an explosion at the point of impact. Simulate the explostion using a variation of the starburst example - centered at point of x axis intercept
Note that I have prevented the rocket from entering the ground. Write code to prevent it from exceeding the top of the y axis
and the end of the x axis.
Use code to place a title for the program on the form near the top (not same task as first bullet above)
At approximately the mid point of the horizontal axis, cause a square with blue borders to be placed randomly in the vertical
direction so that It varies from 10 to the length of the y axis. The length of a side should be no larger than 1/10 the length of the x axis
If the rocket hits this target, a message box should announce "ouch" or some appropriate message.
If the rocket misses this target, a message box should announch "missed" or some appropriate message.
This is a continuation of Rocket Program, Part b
Change the above to incorporate the following
Ø Use Input Boxes to prompt the user for the time of flight, launch angle, and initial velocity.
Ø If the rocket hits the target, then draw a starburst at the point of impact such that the starburst does not completely obliterate (hide from view) the box (or
target). You do not need a message block to indicate the hit.
Ø If the rocket misses the target, then draw a starburst at the point of impact with the x axis. Only the top part of the starburst should be shown.
Ø Place an appropriate title at the top of the trajectory (using code) and also label the form (using code).