Program+14

Blue Ball Continually Moves on X-Axis Program #14 In this program you will create a SUBROUTINE called: "DrawBall" that will receive two PARAMETERS (arguments). Mr. Martin, What is a PARAMETER? Well a PARAMETER is a piece of data that you pass to a SUBROUTINE. It could be a constant (ex: 17) or it could be a variable (ex: X). Mr. Martin, What is a SUBROUTINE? A SUBROUTINE is a small section of your program that you isolate from the main program. You give the small section of program code a name like "DrawBall" and when you want the small program (SUBROUTINE) to be executed, you simply type in the name. So, whenever you want to have a ball drawn you would type DrawBall and execution would leave the main program and start running the SUBROUTINE DrawBall. Then execution would begin running DrawBall. Where will the ball be drawn? You know that is a great question, and it leads into the PARAMETERS that I discussed earlier. You will need to give the SUBROUTINE X and Y coordinates which dictate where to draw the ball. Hey that is pieces of data that you are passing to the SUBROUTINE. That is a great example of PARAMETERS! Your SUBROUTINE "DrawBall" should do the following: 1) Accept the X and Y coordinates of where you want to draw the ball on the screen. Note: If you want to have the ball move on the X-Axis, then the Y coordinate will be ZERO! That is correct a CONSTANT.  2) Draw the Ball 3) Wait for a while by using another SUBROUTINE that you write called "Wait1". This will only be a "FOR" loop that does nothing. Let it iterate a couple of hundred times .... That should do it.  4) Draw the Ball again But this time use WHITE! Hey where did the ball go??? 5) Now that should do it (at least for our SUBROUTINE).  Your Main Program should do the following:   1) Make the Ball go to the Right until it hits the side of your screen, then it should go left until it hits the side of your screen. 2) Go back and do step 1 again and again and again and again and again and again .... hey can you say LOOP?  Remember, "All you lack is finishing up" :)