2 10
2 10
4617010059
TI 3A
Java Fundamentals
2-10: Variables
Practice Activities
Lesson Objectives:
• Understand variables and how they are used in programming
1. Declare a variable.
a. View the declared "bipedHop" procedure under the Biped class.
JAWAB :
b. Declare a variable in the bipedHop procedure named "hopHeight".
c. Give hopHeight a value type of DecimalNumber and initialize the variable to
.25.
JAWAB :
c. In the Alice code change the first value from .25 to .45.
JAWAB :
d. Identify the code that shows this change in the java code window.
JAWAB :
e. Change the value back to .25.
JAWAB :
Java Fundamentals
2-11: Keyboard Controls
Practice Activities
Lesson Objectives:
• Use keyboard controls to manipulate an animation
c. Program another motion so that the bunny turns a quarter turn to the left
when the "L" keyboard key is pressed.
JAWAB :
d. Test the animation and use the keyboard keys to move the bunny around
the scene, avoiding the wall, white rabbit, and hedges.
e. Save the project.
4. Save your biped class so that you can use the hop procedure in other
animations.
a. Click on the classes list button and choose Biped and then biped again.
JAWAB :
b. Save the biped class to your MyClasses directory using the Save to class file
button
JAWAB :
Lesson Objectives:
• Use keyboard controls to manipulate an animation
• Use functional decomposition to write a scenario and storyboard
• Complete an animation
• Test an animation
• Reposition objects at runtime
• Plan the presentation of a completed animation project
vii. Functions
viii. IF and WHILE control statements
ix. Random numbers
x. Math expressions
xi. Variables
xii. Keyboard controls
2. Design a storyboard for a complete animation.
a. Create a storyboard for a rabbit and meadow scene animation that
includes all concepts learned in this course.
b. Use the scenario you created in the previous activity to help develop your
storyboard.
3. Program a complete animation.
a. Optional: Open the "WhiteRabbitProject" project file. You can start from
this project or start a new project from scratch.
b. Program a complete for a rabbit and meadow scene animation that
includes all concepts learned in this course.
c. Use the scenario and storyboard you created in the previous activity.
d. Review the checklist for animation completion below. Use this checklist to
ensure your animation is complete.
e. Save the project.
4. Test and debug a complete animation.
a. Test, edit, and debug the complete White Rabbit animation project.
b. Add programming comments to each section of code in the code editor.
c. Save the project.
5. Reposition objects at runtime.
a. Add the addDefaultModelManipulation procedure into the
initializeEventListeners code editor.
b. Test the animation, repositioning objects at runtime.
c. Save the project.
6. Upload your animation to YouTube.
a. Use the facility in the file menu to upload your animation to Youtube using
your Youtube account.
b. Save a copy of your animation as a local file on your machine.
7. Present a complete animation.
a. On your own or with your project group, plan, practice and deliver a
presentation of your complete Alice 3 animation. Show all aspects of your
animation and show how each concept learned in this course was used in
your complete Alice 3 animation project.