Fundamentals of Software Development 1Slide 1 Acrobat Games: An introduction to object-oriented design We need 11 volunteers – –BasicAcrobat x 3 – –ProudAcrobat.

Slides:



Advertisements
Similar presentations
CRA-W Career Mentoring Workshop. What is networking? Making professional connections and using them wisely.
Advertisements

Bluff on the Move. Summary and Rationale In this game students get up and move when they know or think they know the answer to a question. Students are.
Amazing Math Trick 234X =??? Trick! Trick!
K-3 Alternative Safe Environment Training
Fundamentals of Software Development 1Slide 1 Outline of this exercise Learning objectives:Learning objectives: –After this exercise, a student should.
1 Introductions to: - Each other - Object-Oriented Programming (OOP) - Java CSSE 220—Object-Oriented Software Development Rose-Hulman Institute of Technology.
Chair of Software Engineering 1 Introduction to Programming Bertrand Meyer Exercise Session 4 30 September 2008.
CSE 115 / 503 Introduction to Computer Science For Majors I Carl Alphonce 219 Bell Hall.
Fundamentals of Software Development 1Slide 1 Acrobat Games – Debriefing: Interfaces For each type of object, what operations can that object do?For each.
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer Exercise Session 3.
CSE 115 / 503 Introduction to Computer Science For Majors I Carl Alphonce 219 Bell Hall.
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer Exercise Session 3.
Fundamentals of Software Development 1Slide 1 UML class diagrams: Outline Why types / classes are importantWhy types / classes are important –Why types.
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer Exercise Session 3.
CS 106 Introduction to Computer Science I 03 / 17 / 2008 Instructor: Michael Eckmann.
ICE BREAKERS. WHAT SHOULD YOU ACCOMPLISH WITH AN ICEBREAKER? * Grab participants’ attention * Establish a participative climate in which everyone is involved.
Speed Chatting Organize students into an inner and outer circle so that students are paired with someone in the opposite circle. Give students a prompt,
Enrichment Activities
Reflective practice Session 4 – Working together.
Ideas for revision activities. Show me the answer! Using mini-whiteboards, true/false cards, hand signals, different coloured cards etc. pupils must show.
Classroom Management HealthW.I.S.E.. Table of Contents  Slide One: Classroom Rules  Slide Two: Keeping Control  Slide Three: Inappropriate Responses.
©Marian Small, 2010 Big Ideas K-3 Session 2 Marian Small.
CSCI-383 Object-Oriented Programming & Design Lecture 9.
Student Engagement Using the T4S Model.
Chapter 11 Introduction to Classes Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg.
Running Records SUE pALMER 2010
SE-1010 Dr. Mark L. Hornick 1 Introduction to Object-Oriented Programming (OOP) Part 1.
I am ready to test!________ I am ready to test!________
Interviewing the Internalized Other Part 2: applied in couple work Workshop for OAMFT in Toronto 2 November 2012 by Karl Tomm MD.
Fundamentals of Software Development 1Slide 1 Outline of this exercise Learning objectives of the tutorial:Learning objectives of the tutorial: –After.
Classroom Procedures Mrs. Mirick Enter the Classroom  Walk quietly into the room.  Sharpen pencils, turn in homework, get your spiral from.
August 19, 2015 Do Now  On a ticket, write your name.  On scratch paper, write down definition of formative assessment  Find a partner to work with.
Class Usability Experience User slides are in BLUE.
What is empathy ? (call on a few students to brainstorm the definition of empathy)
The Games. NameHow to Play Likely Learning Outcome PropsTime Yes Lets When I say “Hey” you say “Hey What?” When I say “Lets” you say “Lets What?” “Lets…
Sherwood State School Behaviour Skills Streaming.
Academic Communication Lesson 8 (1) Please pick up one handout from the front desk. (2) Look at the exam sign-up sheets at the front and sign up for one.
Xmania!.
Fundamentals of Scientific Research Dr. Samer Odeh Hanna (Ph.D.)
Partner A SOLVES the first problem.
Fundamentals of Software Development 1Slide 1 Artwork: An introduction to programming primitives Draw a picture [1 minute]Draw a picture [1 minute] –It.
Today you will need…… Your math journal A pencil A “Making Doubles” recording sheetMaking Doubles.
Warm-up Ideas Warm-ups help your learners put aside their daily distractions and focus on English. If they haven't used English all day, they may take.
EVOC 504 Class Activity Donna Shea, Instructor Objective By the end of this activity you will be able to: Interact with each other willingly Obtain information.
This is a quick and fun game that you can play with your team or new team members It shows in an interactive way, the benefits of putting things in the.
More – means the number is bigger like an elephant. Less – means the number is smaller like a mouse.
Chair of Software Engineering Einführung in die Programmierung Introduction to Programming Prof. Dr. Bertrand Meyer Exercise Session 3.
Sight Words.
GRADE 3, MODULE 1, LESSON1 MULTIPLICATION © Helen Steinhauser, August 2015.
How to Help Your Child with Maths INSPIRE 5KW. This morning? “They do it all differently these days!” Bridging the gap They are teaching you this morning!
Donna Shea, Instructor  Interact with each other willingly  Obtain information about each other comfortably  Introduce each other to the class  Develop.
Six people sit in a row. Left to right, they are numbered 1 through 6.
Jigsaw Counting A Counting Game 1-5 Instructions In each slide there is puzzle pieces for you to count. There four answers to pick from. Choose the correct.
“A change of heart about animals” By jeremy Rifkin
Skills For Effective Communication
Single Digit Addition Flash cards.  The program starts with introduction.  Today, we’re going to play single digit numbers addition and flash cards.
Math Facts Pick-up Cards Click to enter. Deck 1 Deck 2 Deck 3 Deck 4 INTRO.
Strategies & Knowledge for Independent Learning individual Work SKIL SKIL cards are sets of cards that explain how to use different learning strategies.
You are an Acrobat When you are asked to Clap, you will be given a number. Clap your hands that many times. When you are asked to Twirl, you will be given.
1 Use Cases Object-Oriented Modeling and Design with UML (Second Edition) Blaha & Rumbaugh Sections 7.1, 8.1.
Mental Health Activities: Decision Making Peer Pressure Risk Taking.
Balancing Your Stress.
LO: to recognise < > and = symbols
IT: The Caterpillar.
Welcome! January 12th, 2018 Friday
BULLYING & CYBERBULLYING
Scottish Improvement Skills
Computational Thinking for KS3
Einführung in die Programmierung Introduction to Programming Prof. Dr
Tips and tricks to getting the most out of your sources
Presentation transcript:

Fundamentals of Software Development 1Slide 1 Acrobat Games: An introduction to object-oriented design We need 11 volunteers – –BasicAcrobat x 3 – –ProudAcrobat x 2 – –DoublingAcrobat – –AcrobatWithBuddy x 2 – –Choreographer x 2 – –Curmudgeon Instructor: – –Write the 6 types on the whiteboard – –Beside each type, write the names of the actors for that type – –Announce instructions per the next slide This exercise is adapted from Joe Bergin’s page at that describes an idea presented by Steven K. Andrianoff and David B. Levine at SIGCSE Each volunteer gets: Red sheet with instructions for how to behave Yellow sheet (blank): scratch pad White sheets (blank): for returning data

Fundamentals of Software Development 1Slide 2 Acrobat Games (continued) basicAcrobat1.clap(2);basicAcrobat1.clap(2); basicAcrobat2.twirl(1);basicAcrobat2.twirl(1); basicAcrobat1.twirl(2);basicAcrobat1.twirl(2); basicAcrobat1.count();basicAcrobat1.count(); basicAcrobat3.count();basicAcrobat3.count(); basicAcrobat3.sing();basicAcrobat3.sing(); proudAcrobat1.clap(3);proudAcrobat1.clap(3); proudAcrobat2.twirl(1);proudAcrobat2.twirl(1); proudAcrobat1.bow();proudAcrobat1.bow(); curmudgeon.twirl(3);curmudgeon.twirl(3); curmudgeon.clap(3);curmudgeon.clap(3); acrobatWithBuddy1.clap(4);acrobatWithBuddy1.clap(4); acrobatWithBuddy1.clap(2);acrobatWithBuddy1.clap(2); acrobatWithBuddy1.twirl(1);acrobatWithBuddy1.twirl(1); acrobatWithBuddy1.nameBuddy();acrobatWithBuddy1.nameBuddy(); acrobatWithBuddy2.nameBuddy();acrobatWithBuddy2.nameBuddy(); acrobatWithBuddy2.clap(3);acrobatWithBuddy2.clap(3); acrobatWithBuddy2.jump(4);acrobatWithBuddy2.jump(4); acrobatWithBuddy2.count();acrobatWithBuddy2.count(); acrobatWithBuddy1.twirl(1);acrobatWithBuddy1.twirl(1); acrobatWithBuddy1.nameBuddy();acrobatWithBuddy1.nameBuddy(); acrobatWithBuddy2.nameBuddy();acrobatWithBuddy2.nameBuddy(); doublingAcrobat.clap(3);doublingAcrobat.clap(3); doublingAcrobat.count();doublingAcrobat.count(); doublingAcrobat.twirl(100); // just kidding!doublingAcrobat.twirl(100); // just kidding! choreographer1.clap(3);choreographer1.clap(3); choreographer2.clap(2);choreographer2.clap(2); choreographer1.count();choreographer1.count(); basicAcrobat1.count();basicAcrobat1.count(); The instructor announces these commands (using students’ names or basicAcrobat1, etc). When paper returns to the instructor after a count command, she will announce what is on the paper.

Fundamentals of Software Development 1Slide 3 Instructions for the actors The next six slides give the instructions that tell each actor how to behave.The next six slides give the instructions that tell each actor how to behave. There is a single set of instructions for each type of actor:There is a single set of instructions for each type of actor: –BasicAcrobat –ProudAcrobat –DoublingAcrobat –AcrobatWithBuddy –Choreographer –Curmudgeon

Fundamentals of Software Development 1Slide 4 You are a BasicAcrobat When you are asked to: clap, you will be given a number. Clap your hands that many times. twirl, you will be given a number. Turn completely around that many times. count, write on a piece of paper how many actions (claps and twirls) you have performed so far. – –For example, after clap 2 and twirl 1 you would write 3 on the paper. Give that paper to the person who asked you to count. If you are asked to do anything else, say (as dramatically as you can) “I refuse”

Fundamentals of Software Development 1Slide 5 You are a ProudAcrobat When you are asked to: clap, you will be given a number. Clap your hands that many times. Say “Thank you.” Then take a bow (as dramatically as you like). twirl, you will be given a number. Turn completely around that many times. Say “Thank you.” Then take a bow (as dramatically as you like). count, write on a piece of paper how many actions (claps and twirls) you have performed so far. – –For example, after clap 2 and twirl 1 you would write 3 on the paper. Give that paper to the person who asked you to count. Say “Thank you.” Then take a bow (as dramatically as you like). bow, say “Thank you.” Then take a bow (as dramatically as you like). If you are asked to do anything else, say (as dramatically as you can) “I refuse”

Fundamentals of Software Development 1Slide 6 You are a DoublingAcrobat When you are asked to: clap, you will be given a number. Clap your hands twice that many times. – –For example, if you are told to clap 3 then you should clap 6 times twirl, you will be given a number. Turn completely around twice that many times. – –For example, if you are told to twirl 2 then you should twirl 4 times count, write on a piece of paper how many actions (claps and twirls) you have performed so far. – –For example, after twirl 2 and clap 3 you would have twirled 4 times and clapped 6 times, so you would write 10 on the paper Give that paper to the person who asked you to count. If you are asked to do anything else, say (as dramatically as you can) “I refuse”

Fundamentals of Software Development 1Slide 7 You are an AcrobatWithBuddy When you are asked to: clap, you will be given a number. Clap your hands that many times. Then pass that same instruction to your Buddy. twirl, you will be given a number. Turn completely around that many times. Then pass that same instruction to your Buddy. count, first ask your Buddy to count. Your Buddy should then give you a piece of paper with a number written on it. Add that number to the number of actions (claps and twirls) you have performed so far, and write that sum on your own piece of paper. – –For example, after clap 2 and twirl 1 your own count would be 3. So if your Buddy gives you a piece of paper with (say) 7 written on it, write 10 on your own piece of paper. Then give your own piece of paper to the person who asked you to count. nameYourBuddy, say (loudly) the name of your Buddy If you are asked to do anything else, say (as dramatically as you can) “I refuse” When you are given this card, before we start the role play, you should (mentally) choose another actor (anyone except a Curmudgeon) to be your Buddy. That person will be your Buddy for the rest of the exercise

Fundamentals of Software Development 1Slide 8 You are a Choreographer When you are given any instruction (such as twirl, clap, or count), pass it on to two other actors. – –For example, if you are told to clap 3 then you might respond by saying John, clap 3 and when John has finished, saying Mary, clap 3 assuming that John and Mary are names of two of the actors. You should not clap. – –Do not directly refuse any command. However, if either of your two actors says “I refuse,” then you say “I refuse.” – –If the command is count: Both of your actors will eventually hand you a piece of paper (unless they refuse, in which case you refuse) Add the two numbers from their papers and write the sum on your own paper Then give your own paper to the person who asked you to count Pick your two actors at random each time (but never pick a Curmudgeon). You can pick the same actor twice (instead of two different actors) or you can even pick yourself as one (or both) of the actors. Try these! But don't do these fancy tricks the first time a Choreographer is given an instruction.

Fundamentals of Software Development 1Slide 9 You are a Curmudgeon When given any instruction (such as twirl, clap, or count), ignore it. Stand up, cross your arms over your chest, smirk, and say (as smugly and dramatically as you can) “I refuse.” Then sit down again if you were originally sitting.

Fundamentals of Software Development 1Slide 10 Acrobat Games – Debriefing: Classes and Objects What are the names of some classes represented in Acrobat Games?What are the names of some classes represented in Acrobat Games? –See below What are the names of some objects?What are the names of some objects? –john, mary, … (names of the actors in your classroom) –Or perhaps you think of them as named by numbers: basicAcrobat1, basicAcrobat2, basicAcrobat3 proudAcrobat1, proudAcrobat2 etc.basicAcrobat1, basicAcrobat2, basicAcrobat3 proudAcrobat1, proudAcrobat2 etc. Can there be more than one object from the same class?Can there be more than one object from the same class? –Yes! BasicAcrobat AcrobatWithBuddy ProudAcrobat DoublingAcrobat Choreographer Curmudgeon

Fundamentals of Software Development 1Slide 11 Acrobat Games – Debriefing: Operations What are the names of some operations that the objects in Acrobat Games can do?What are the names of some operations that the objects in Acrobat Games can do? –clap, twirl, count, bow, nameBuddy –Later we will call these operations methods Are all objects able to do the same operations?Are all objects able to do the same operations? –No. For example, only an AcrobatWithBuddy can nameBuddy Are all objects of the same class able to do the same operations?Are all objects of the same class able to do the same operations? –Yes. For example, all ProudAcrobats can bow

Fundamentals of Software Development 1Slide 12 Acrobat Games – Debriefing: Interfaces For each type of object, what operations can that object do?For each type of object, what operations can that object do? ProudAcrobat clap twirl count bow AcrobatWithBuddy clap twirl count nameBuddy DoublingAcrobat clap twirl count Choreographer clap twirl count BasicAcrobat clap twirl count Curmudgeon throws an Exception > Acrobat clap twirl count implements Is there any commonality? Any operations that all the classes (except Curmudgeon) must implement? Any protocol that all must obey?Is there any commonality? Any operations that all the classes (except Curmudgeon) must implement? Any protocol that all must obey? Yes! The Acrobat interfaceYes! The Acrobat interface

Fundamentals of Software Development 1Slide 13 Acrobat Games – Debriefing: is-a and has-a ProudAcrobat clap twirl count bow 1 2 > Acrobat clap twirl count AcrobatWithBuddy clap twirl count nameBuddy DoublingAcrobat clap twirl count Choreographer clap twirl count BasicAcrobat clap twirl count Curmudgeon has-a is-a A ProudAcrobat is-a BasicAcrobat – It inherits all the attributes and operations of a BasicAcrobat An AcrobatWithBuddy has-a Acrobat – It can ask its Acrobat buddy to do things What other is-a relationships exist above? has-a?

Fundamentals of Software Development 1Slide 14 Acrobat Games – Debriefing: arguments and returned values When asking an object to perform an operation, we say three things. What are they?When asking an object to perform an operation, we say three things. What are they? object that is to perform the operation Name of operation Argument sally.clap(2) What determines how a particular object performs the clap operation?What determines how a particular object performs the clap operation? –Answer: What class it is an instance of. For example, a BasicAcrobat claps one way, while a ProudAcrobat claps another way. Also, what argument it is given. sally.clap(2) claps twice, while sally.clap(6) claps six times. Do objects have to act alone when performing?Do objects have to act alone when performing? –No. For example, a Choreographer asks others to act on its behalf. How are the clap and count operations fundamentally different?How are the clap and count operations fundamentally different? –Answer: clap does something, while count returns a value.

Fundamentals of Software Development 1Slide 15 Acrobat Games – Summary In Acrobat Games, we saw many of the ideas of Object-Oriented Programming (OOP), including:In Acrobat Games, we saw many of the ideas of Object-Oriented Programming (OOP), including: –Classes (BasicAcrobat, ProudAcrobat, …) –Objects (proudAcrobat1, proudAcrobat2, … – instances of the classes) –Methods (the operations clap, twirl, count, …) Arguments: clap(2)Arguments: clap(2) Returned values: from countReturned values: from count –Encapsulation in classes and in methods –Internal state (each object keeps track of its count) –Inheritance (e.g., ProudAcrobat is-a BasicAcrobat) –Associations (e.g., an AcrobatWithBuddy has-a Acrobat) –Implementing to an interface (… implements the Acrobat interface) –Exceptions (e.g., from Curmudgeons) –UML class diagrams (that show relationships between classes)