Back to School Night
Review of Inheritance
Superclasses - a more general definition of a class, includes all the things that the subclasses have in common. - slide 17
Subclasses - has all of the characteristics of a superclass but more details that make it unique
Inheritance - a subclass inherits all of the superclass's methods, procedures, functions and properties.
Stop n write:
1.
List three superclasses in Alice.
2. Choose one of those superclasses and list three of its subclasses.
3. Open a scene and add a chicken to the scene. In the code editor click on the pull down menu next to the Scene tab and select Chicken - a new tab should open titled Chicken. Look at the terms at the top of this tab, what key word indicates that the Chicken class is a subclass of the Flyer class?
Examples of superclasses and subclasses in Alice -
Slide 19 - if you want your code to be used by other subclasses then write the code for the superclass and all subclasses will inherit the code.
Slide 21 - creating your own methods - if a procedure does not exist for what you want to do you can create your own!
Slide 26 - Procedural Abstraction - if there are repetitive tasks, then write a procedure for that task so that you do not need to duplicate code.
Slide 46 - this. object identifier - when you create a procedure that can be applied to many subclasses the this. identifier is used. This refers to the instance calling the procedure, this could be Alice, a dog, a fish. This refers to the current object.
Complete Section 2-4 Rotation and Randomization practice. Save steps 1-4 as S2-4 White Rabbit Last Name. Save optional activity 1 as S2-4 Horse Last Name, activity 2 as S2-4 Penguin Flap Last Name, activity 3 as S2-4 Spinner Last Name. Demonstrate these programs for teacher check. Be sure you have comments in your code.
Complete Section 2-4 Rotation and Randomization project and save the project as Fish_4 Project Last Name. Demonstrate the working project to your instructor for teacher check.
Once you have completed these sections begin working on your own animation - the one you story boarded. If you have time begin creating the scene for your animation.
Add the following Section 2-5 Vocabulary to your Java vocabulary list:
- A story that gives the animation a purpose.
-
Procedures that are created by the programmer.
-
A list of actions to perform a task or solve a problem.
-
When each subclass object receives the methods and properties of its superclass.
-
Identifies the design specifications for the animation scenario. Two types are visual and textual.
-
The process of looking at programming code, identifying repetitive programming statements, and extracting them into their own methods in order to make the code easier to understand and reuse.
Begin Section 2-5 Declare Procedures practice. Save steps 1-4 as S2-5 White Rabbit Last Name. Save optional activity 1 as S2-5 Flow Chart Name, activity 2 as S2-5 Helicopter Last Name, activity 3 as S2-5 Flying Last Name, activity 4 as S2-5 Bunny Soccer Last Name. Demonstrate these programs for teacher check. Be sure you have comments in your code.
Begin Section 2-5 Declare Procedures project and save the project as Fish_5 Project Last Name. Demonstrate the working project to your instructor for teacher check.
Once you have completed these sections continue working on your own animation - the one you story boarded. Remember to make procedures for tasks that will be repeated often.
Exporting and Importing Modified Classes