Question: its a lab question. help ersity | Course: 18191 (FA 18)-CSCI 21 E D x Microsoft Word-La64 /moodle.depauw.edu/pluginfile.php/326361/mod_resource/content/1/Lab4,pdf Create Create a Driver object and invoke
ersity | Course: 18191 (FA 18)-CSCI 21 E D x Microsoft Word-La64 /moodle.depauw.edu/pluginfile.php/326361/mod_resource/content/1/Lab4,pdf Create Create a Driver object and invoke the start) method observing the simple Read Open the editor for the Driver class. Read Driver's field definitions and the class Add Add the following actions to the startO method: Result. Note: In our previous labs, the Artist class was the Driver. constructor. Understand why the ball moves as it does 1. Modify the loop that moves the ball ten times, so that it moves the ball (circle) from its initial position to the lower-right corner of the window on a 45 degree angle instead. Use moveDirection) with xDistance and yDistance equal to 3. The ball should not go completely out of the window. You will need to remove the code that causes the ball to move only ten times. Test this before going to the next step. 2. Have the rocket (triangle) move vertically to the top of the window, at which time it stops. You should use a while loop. You will need to compare the yPosition of the rocket with the yCoordinate of the top of the window to know when to exit the while loop. Use the moveDirection() method with x Distance = 0 and yDistance=-3 Test this before going to the next step. Note: When you are done with this step, the ball and the rocket will both move, one after the other. Write Create a new method, bounceBall), that moves the ball smoothly to the "floor" of ersity | Course: 18191 (FA 18)-CSCI 21 E D x Microsoft Word-La64 /moodle.depauw.edu/pluginfile.php/326361/mod_resource/content/1/Lab4,pdf Create Create a Driver object and invoke the start) method observing the simple Read Open the editor for the Driver class. Read Driver's field definitions and the class Add Add the following actions to the startO method: Result. Note: In our previous labs, the Artist class was the Driver. constructor. Understand why the ball moves as it does 1. Modify the loop that moves the ball ten times, so that it moves the ball (circle) from its initial position to the lower-right corner of the window on a 45 degree angle instead. Use moveDirection) with xDistance and yDistance equal to 3. The ball should not go completely out of the window. You will need to remove the code that causes the ball to move only ten times. Test this before going to the next step. 2. Have the rocket (triangle) move vertically to the top of the window, at which time it stops. You should use a while loop. You will need to compare the yPosition of the rocket with the yCoordinate of the top of the window to know when to exit the while loop. Use the moveDirection() method with x Distance = 0 and yDistance=-3 Test this before going to the next step. Note: When you are done with this step, the ball and the rocket will both move, one after the other. Write Create a new method, bounceBall), that moves the ball smoothly to the "floor" of
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
