Chapter 4: Classes, Objects, and Parameters 4.1 World-Level methods.

Slides:



Advertisements
Similar presentations
As you come in… DOWNLOADS FOR TODAY: Alice Project: Wanda Dann and Don Slater, CMU What do you still need (Alice content/understanding)?
Advertisements

Repetition everywhere – comparing while in a method and as an event Susan Rodger Duke University July 2010 modified July 2011.
Getting Started With Alice By Ruthie Tucker under the direction of Prof. Susan Rodger Duke University, July
Class-level Methods Alice. World / Class Method World method A general method that may refer to multiple objects; not closely associated with any particular.
Class-level Methods and Inheritance Part 1 Alice.
The LC-3 – Chapter 6 COMP 2620 Dr. James Money COMP
How Tall Are You? Introducing Functions By Jenna Hayes under the direction of Professor Susan Rodger Duke University July 2008 Updates made June 2014 by.
101.  Computers DO NOT think for themselves. For them to do anything they need to be told what to do.  Simply put computer programming is when you tell.
Chapter 4.3 Class level methods (versus previous world-level methods)
Fall 2008ACS-1805 Ron McFadyen1 Programming Concepts Chapter 4 introduces more advanced OO programming techniques. Construction of a programs usually requires:
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
Chapter 9.1: Lists Lists are often called by another name in other programming languages – arrays.
Section 2.3 Gauss-Jordan Method for General Systems of Equations
Fall 2007ACS-1805 Ron McFadyen1 Chapter 5 Interactive Programs.
Alice Variables Pepper. Set to Java look Edit / preferences restart.
Classes, Objects, and World-level Methods Alice. Programming in Alice© 2006 Dr. Tim Margush2 Class / Object Class A template describing the characteristics.
Introduction to Software Engineering CS-300 Fall 2005 Supreeth Venkataraman.
Fall 2008ACS-1805 Ron McFadyen1 Programming Concepts Chapter 4 introduces more advanced OO programming techniques. Construction of a programs usually requires:
Alice Learning to program: Part 1 Scene Setup and Starting Animation by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke.
Methods Tutorial: Part One By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June 9, 2008.
METHODS!.  A method is a sequence of instructions or behaviors that will be carried out when requested.  You can use them to create new methods so that.
Alice Learning to program: Part Two by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2008.
Lecture 2: CSE3: Fluency in Information Technology Read csemoodle.ucsd.edu – Homework for next Monday (you don’t turn anything in) – Joined class late,
01-Intro-Object-Oriented-Prog-Alice1 Barb Ericson Georgia Institute of Technology Aug 2009 Introduction to Object-Oriented Programming in Alice.
Chapter 7: Repetition 7.1 Definite loops (counted) 7.2 Conditional loops (indefinite)
Classes, Objects, and World-level Methods
Microsoft Windows LEARNING HOW USE AN OPERATING SYSTEM 1.
Classes, Objects, and World-level Methods Alice. Larger Programs As you become more skilled in writing programs, you will find that programs quickly increase.
Classes, Objects, and World-level Methods Section 47 Web Design.
by Chris Brown under Prof. Susan Rodger Duke University June 2012
Making a Timer in Alice.
Lecture 5: Finishing 4.3 and onto 5.1 Preparing for the Midterm: Written Explanations Technology and Society Assignment (5% - 3 in term) – How does the.
In.  This presentation will only make sense if you view it in presentation mode (hit F5). If you don’t do that there will be multiple slides that are.
Classes, Objects, and World-level Methods Alice. Larger Programs As you become more skilled in writing programs, you will find that programs quickly increase.
Top-Down Design and Modular Development
Class-level Methods Chapter 6 part 1. Classes and Objects Classes o In Alice, classes are predefined as 3D models Objects o An object is an instance of.
Alice Project 1 Web Design. Electronic Greeting Card Build an animation for an electronic greeting card (any occasion you choose – birthday, get well,
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
Alice 2.0 Introductory Concepts and Techniques Project 1 Exploring Alice and Object-Oriented Programming.
CS329e – Elements of Visual Programming Implementing Programs Mike Scott (Slides 2-2)
Moving Around in Scratch The Basics… -You do want to have Scratch open as you will be creating a program. -Follow the instructions and if you have questions.
Lecture 3: Chapter 4.1 and 4.2 Discussion groups: Very impressed! – Excellent job by class-wide discussion contributors Learning Goal: Technical analysis.
Hi, Learning Skills Students! This is Slide 1 of your Power Point Instruction for this class. After reading each slide, make sure you: 1.Follow the instructions.
Making Decisions uCode: October Review What are the differences between: o BlueJ o Java Computer objects represent some thing or idea in the real.
Classes, Objects, and World-level Methods Alice. Larger Programs As you become more skilled in writing programs, you will find that programs quickly increase.
Alice Learning to program: Part Two Writing Your Own Methods by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke University,
Resources for Paraeducators Website
Bunny Eat Broccoli Repetition – Simple loops and Conditional loops Susan Rodger Duke University July 2011.
1 Quiz Template: Using the ‘ask user’ functions By Deborah Nelson Duke University Under the direction of Professor Susan Rodger July 2009.
Top Down Design Brent M. Dingle Texas A&M University Chapter 4 – Section 1 (and some from Mastering Turbo Pascal 5.5, 3 rd Edition by Tom Swan)
Conditional Statements.  Quiz  Hand in your jQuery exercises from last lecture  They don't have to be 100% perfect to get full credit  They do have.
The Essentials of Alice Mrs. Jayne Slease SBMS CTE Computer Science and Animation Credit to Duke Students under the direction of Professor Susan Rodger.
My Mission Statement To ensure students leave the course with an intermediate knowledge of general programming skills they can transfer to other platforms.
Chapter 5 Interaction: Events and Event Handling.
Python Lesson 1 1. Starter Create the following Excel spreadsheet and complete the calculations using formulae: 2 Add A1 and B1 A2 minus B2 A3 times B3.
The single most important skill for a computer programmer is problem solving Problem solving means the ability to formulate problems, think creatively.
Repetition everywhere – comparing while in a method and as an event Susan Rodger Duke University July 2010.
Using Placeholders to Simplify your Methods: Learning Methods, Part 2 By Deborah Nelson Duke University Professor Susan Rodger June 16, 2008.
Lecture Wed Week 7 Midterm grades on gradesource – Graded out of 26 (free point) – Question 1 confusing – everyone gets full points – Solutions posted.
Alice Development Environment. Which area contains our “program” (set of instructions)? D AB C.
FOP: Multi-Screen Apps
Broadcasting (Adding a new level)
Classes, Objects, and World-level Methods
Chapter 10: Void Functions
Learning to program with Logo
Class-level Methods Alice.
Computational Thinking for KS3
Introduction to Python
Presentation transcript:

Chapter 4: Classes, Objects, and Parameters 4.1 World-Level methods

Chapter 4.1 Learning Goal: Technical analysis and communication skills – Tutors help you “ask yourselves the right questions”

What do you get from this course? Analysis skills – – Practiced and refined in your group discussions! We learned in Alice that computers do exactly what you have them do. Using this knowledge, we can understand how programs like Excel and Numbers work and learn that when we are using these programs, we need to specify and be exact with what we are doing in order for the programs to meet our needs and plans.

Clicker Discussion Analysis Technique: Begin at the beginning: – Are you reading the question the “same way”? – What is the question asking for? TRY THESE: – “So what I think this is asking is” – “It seems like the idea here is whether we can identify the differences in these codes” – “We need to figure out how to correct this code to do X instead of Y”

What is the best explanation of why we divide code into methods? A.In order to be able to put a name on them B.In order to break work into manageable pieces C.So it can be stored more efficiently D.So that each object can have “actions” they do

What term do we use to describe the indicated area below A. Method call B. Method definition

When you hit Play Alice will by default*: A.Runs World.My first method B.Starts by running whatever method you created first C.Starts by running whatever method you created last D.Runs all the methods in the order they appear in the methods tab E.None of the above *Assuming you don’t modify any of the events in the upper right corner

The First Encounter World In chapter 2 you developed the first encounter world and created the following code…

Step-wise refinement Break the work up into three methods – Call those methods from my first method

One should use methods in programs primarily… A.For the computer B.For the person writing the program C.For people reading a program D.More than one of the above And WHY is it important?

How to “make” methods Think of ways in which your planned animation has natural “parts” – Give each of the parts a name – Put the code that makes that “part” happen in a method with that name – Call that method from my first method, in the right order.

Example: Going to a movie… Walk up to ticket window – Walking in group Buy tickets – Interact with ticket seller (talking, hand over money, get tickets) Enter theater – Walk through doors, hand tickets to worker, walk into lobby Buy snacks… Take seats… Make snarky critiques… …

Below shows an example of the benefits of using methods because it allows the programmer to… A.Comment methods to further explain what they do B.Re-order the parts of the animation with little extra work C.Repeat a set of instructions with little extra work

Below: what happens after the last instruction in the mystery method is finished executing? A.The program starts the World.my first method B.The program goes back to my first method and calls method XXXXX C.The program goes back to my first method and calls method YYYYY D.We can’t tell, we need to know more about the storyboard to be able to say

Methods: Why again? Break complex things into smaller, more manageable pieces (step-wise refinement) – Do something more than once… Do something more than once, but not exactly the same each time – Parameters allow you to write code one time but have it be useful in various circumstances where the “thing” involved could be different each time