62
2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology [email protected] This material is partially based upon work supported by the National Science Foundation under Award No. DUE- 0442987

2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology [email protected]

Embed Size (px)

Citation preview

Page 1: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Introductory Programming Active Learning Activities

Keith J. WhittingtonRochester Institute of Technology

[email protected]

This material is partially based upon work supported by the National Science Foundation under Award No. DUE-0442987

Page 2: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Active Learning Theory

• If you get students:– Talking, listening, and writing about the

subject– Sharing answers– Teaching each other– Solving problems collectively

• It helps them think critically, and• Deepens their knowledge

Page 3: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

My Basic Premises

• Active learning is good

• Active learning exercises supplement the lecture, not replace it

• Speak less, do more

Page 4: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Active Learning Goals

• Reflect on current knowledge

• Deepen understanding

• Critical thinking

• Build confidence

Page 5: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Reflective Learning

• Use activities to promote student critical reflection on their knowledge

• Ask WHY not how

Page 6: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Lecture

In-class ActivityHW Assignment

Reflective Activity

Design for Significant Learning

Page 7: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Every Main Topic

• Lecture (What)– basic information

• In-class activity (How)– immediate practice

• HW (Practice) – harder application of topic

• Reflection (Why) – critical thinking & deepen knowledge

Page 8: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Getting Started

• Start with “low-risk” activities

• Reject activities that are uncomfortable

• Build your toolbox and confidence

• Don’t give up

• Some things will work, some won’t

Page 9: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Activities - Low to High Risk

• Icebreakers• Paired Programming• Group Questions• Code Analysis / Debugging• Think-Pair-Share• Rapid Programming• Group code• Role Playing• Classroom Code

Page 10: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Activity Steps

• Define your objective

• Design the activity

• Tell students what to do

• Explain why you are doing it

• Display the steps to the class

• Get student feedback

• Modify the exercise for next time

Page 11: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Try Activity

Get FeedbackRevise

Try and Try Again

Page 12: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Icebreakers

• Purpose– Get students talking and sharing – Sets the tone for the entire quarter

• Examples– Interview– Lies

Page 13: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Paired Programming

• Each person has a different role:– Driver – writes the code– Navigator – helps debug, find errors, make

suggestions, etc

• Switch roles at EVERY numbered step– Keeps them engaged

• Answer questions throughout the exercise– Can emulate “real” programming techniques such as

compile and run often

Page 14: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Paired Programming

• In-class activity

• Purpose:– Code more efficiently– Naturally discuss questions before asking for help– Questions become deeper– Help recognize errors quicker– Teach each other

• Must switch roles frequently

Page 15: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Group Questions

• Forces students to: – Talk to each other– Share ideas– Work cooperatively on a difficult question– Teach each other– Learn from each other

• Benefits– Lessens feelings of intimidation– Deepens understanding– Critically think

Page 16: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Group Questions – Enhancing

• One person write a sentence • Next person write a sentence

– Add/improve previous statements

• Rules:– All members need to write a statement– Vocalize your answer to the group– Discuss the team’s answers when finished

• One person will explain answer to the class

Page 17: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

What is the purpose of a constructor?

Page 18: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

What is the purpose of a mutator?

Page 19: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Why are attributes defined as private?

Page 20: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Types of Questions

• Ask questions that require thought

• Ask “why” (conceptual knowledge)

• Cover “how” questions in lecture

• Done after practice with topics

Page 21: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Focus

• Emphasize “Why”, instead of “How“

• Do after they have sufficient practice on the topic

Page 22: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Group Questions – Round Robin

• Take turns doing the following:– Write one answer to the question– Tell group your answer – Pass paper to next person

• Continue until you run out of ideas

• You can “pass”

Page 23: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

List the steps required to create a java application.

Do not use any java syntax, just use common words to describe each

required process.

Page 24: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

List the steps required to create a GUI application that

displays a button.

Page 25: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

List the steps required to have your program react to a button being

pressed.

Page 26: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Types of Questions

• Questions that have multiple answers

• Use for programming techniques that require multiple steps

• Done after practice with topics

Page 27: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Purpose

• Quickly dump ideas

• Reflect on required steps

• Build self-confidence

• Demonstrates that:– No one remembers everything – Groups usually remember everything

Page 28: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Think-Pair-Share

• Listen to the question

• Think about your answer

• Share your answer to the person next to you

• Be prepared to answer question when called upon

Page 29: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Benefits (Shown to Students)

• Learn from each other

• The answer doesn’t have to be yours

• Verbalizing enhances learning

• Forces me to wait longer

• Gives you a chance to think about the question

• Participating has to be less boring

Page 30: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Tell Students

• If peer has best answer, claim it as your own

• If your answer is “dumb”, blame your partner

• Not knowing an answer is okay

Page 31: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Think-Pair-Share

• Purpose– Encourage class participation for all students– Provide students with time to think– Minimize competitive environment– Minimize student embarrassment– Students sharing/teaching students– Leads into next topic

• Displaying questions is very beneficial

Page 32: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

What are user actions called in GUI programs?

Page 33: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

What is an event?

Page 34: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

What type of event is created when a button

is pressed?

Page 35: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

What are the 3 objects used to react to an

event?

Page 36: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

What is a source object?

Page 37: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

What is a listener object?

Page 38: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Group Code Analysis

• Wait until the specific code is shown in class

• Describe the following about the error message:– What line does the error occur– What is the problem– How do you fix it

• Make sure each of you understand

• Prepare to explain this to the class

Page 39: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Example 1public class Example1{

public class method1(){

System.out.println("Hi");}

}

Example1.java:3: '{' expectedpublic class method1()

^Example1.java:7: '}' expected} ^• 2 errors

Page 40: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Example 9public class Example9{

public static void main(String[] args){

int a;int b;b = a + 12;System.out.println("b = " + b);

}}

Example9.java:8: variable a might not have been initializedb = a + 12;

^1 error

Page 41: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Purpose

• Force students to look at compiler errors

• Learn what compiler errors mean

• Show that the compiler gets confused

• Develop troubleshooting skills

• Demonstrate that the compiler helps you

• Working together on complex problems

Page 42: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Rapid Programming

• Roles– Functional class writer– Test class writer– Spokesperson

• Change roles for each problem

Page 43: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Procedure

• Split into groups of 3 and hand out templates• Each card has a role that rotates on every turn

– Functional class writer– Test class writer– Spokesperson

• Show description of requirements– # and types of parameters– Return value

• Put templates on board• Choose a group• Have spokesperson tell the answer

Page 44: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Problem 1

• Create a class with a method that:– Accepts 1 integer parameter– Adds 20 to the parameter– Returns the result of the calculation

• Create a test class that prints the result of the calculation

Page 45: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Problem 4

• Create a class with a method that:– Accepts 1 double and 2 integer parameters– Adds the 2 integer parameters then divides

the sum by the double parameter– Returns the result of the calculation

• Create a test class that prints the result of the calculation

Page 46: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Purpose

• Deepen understanding through repetition• Break the problem into smaller pieces• Spokesperson

– overall understanding

• Test class coder– process return values and send values

• Functional class writer– get parameters and return values

• Rotating gets all involved in different areas

Page 47: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Role Playing

• Act out a HW assignment

• Class determines the objects

• Each group becomes an object

• Discuss role with each individual team

• Run through the program

Page 48: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Classroom Procedure

• User class group starts– Create an object– Get user input for each attribute– Set the attribute in the object– Add object to collection– Get each object out of the collection– Get attributes

• Ask class what went wrong

Page 49: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Purpose

• Easier to visualize objects

• Shows areas of misunderstanding

• Errors naturally occur that they solve

• Demonstrate reasons for OOP concepts

Page 50: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Results

• Some students said it was the single most important activity, and that they now understood OOP

• Some students felt it was the most insulting and demeaning activity they’ve ever done

Page 51: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Group Code

• Used for difficult concepts

• Difficult for one person to do alone

• Used after extensive practice with topic

• Brainstorm a solution

Page 52: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Procedure

• Each group given a different problem

• Each group works on different aspect of a common code design

• Each group writes solution on the board

• Group rep. comes to board and explains solution

Page 53: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Group Code - Inheritance

Person

Employee

Hourly Employee Salary Employee

Page 54: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Group Code - Exercise

• Given the method signature:

– public Employee aMethod(Person p);

• Show all possible ways that this method can be called and how you can return the object that is passed to the method.

Page 55: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

public Employee aMethod(Person p);

Person p;Employee e;SalaryEmployee se;HourlyEmployee he;

aMethod(p) aMethod(e)aMethod(se)aMethod(he)

if(p instanceof Employee)return (Employee)p;

Person

Employee

Hourly Employee

Salary Employee

Page 56: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Results

• Observe students learn

• Subsequent groups come armed with an erasure

Page 57: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Classroom Code - Inheritance

• Each group given specifications for their class

• Each person assigned a role

• Have to interact with other groups

• Code inherits from other groups

Page 58: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Student Procedure

• Create code that inherits from another group

• Each member has unique role:– Get inherited values– Code attributes, accessors, and mutators– Code constructors (multi-arg and default)

Page 59: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Classroom Code - Details

• Multi-arg constructors get values for all attributes (including inherited)

• Super class constructor called with inherited values• Instructor has the ultimate super class• Student send code to instructor• Compile all files• Have teams correct errors and resubmit• At some point draw a UML diagram to show its

purpose (ask students who they inherit from)• Run a test program that creates an object of each

class and displays the values of all attributes

Page 60: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Sample

• Class Name: – Team2

• Inherit from: – Team1

• Variables: – int iT2– String sT2

Page 61: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Multiple Inheritance

Group 1

Group 2

Group 4

Group 7

Group 5

Group 3

Group 6

Group 8

Group 9

Page 62: 2006 Whittington Workshop - DePaul Introductory Programming Active Learning Activities Keith J. Whittington Rochester Institute of Technology kjw@it.rit.edu

2006 Whittington Workshop - DePaul

Results

• Groups communicate with groups

• Discover inheritance complexity

• Students suggest drawing UML diagram

• Entire class engaged debugging the code