PIIT Computer Science Summer Camp - Alice July 10, 2012 Brenda Parker Computer Science Department MTSU.

Slides:



Advertisements
Similar presentations
Mike Scott University of Texas at Austin
Advertisements

Visual Lists By Chris Brown under Prof. Susan Rodger Duke University July 2012.
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
COMPUTER PROGRAMMING I Essential Standard 5.02 Understand Breakpoint, Watch Window, and Try And Catch to Find Errors.
Chapter 3: Editing and Debugging SAS Programs. Some useful tips of using Program Editor Add line number: In the Command Box, type num, enter. Save SAS.
Coloring Randomly: Random Selection in Alice By Jenna Hayes under the direction of Professor Susan Rodger Duke University July 2008.
Decision Structures Chapter 4. Chapter 4 Objectives To understand: o What values can be stored in a Boolean variable o What sequence structures are and.
PIIT Computer Science Summer Camp - Alice July 11, 2012 Brenda Parker Computer Science Department MTSU.
Chapter 1 - An Introduction to Computers and Problem Solving
Chapter 2 - Problem Solving
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming The software development method algorithms.
Programming Creating programs that run on your PC
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering 3 October 2007.
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
Chapter 3 Planning Your Solution
Exploring Microsoft Excel 2002 Chapter 8 Chapter 8 Automating Repetitive Tasks: Macros and Visual Basic for Applications By Robert T. Grauer Maryann Barber.
index.php Palmyra Area High School 1.
Variables and Functions Chapter Variables Named storage location in computer’s memory Programs may need to store data when running o Stored in.
Introduction to VB.NET Tonga Institute of Higher Education.
Working with Numbers in Alice - Converting to integers and to strings - Rounding numbers. - Truncating Numbers Samantha Huerta under the direction of Professor.
An Introduction to Textual Programming
Programming Logic Program Design. Objectives Steps in program development Algorithms and Pseudocode Data Activity: Alice program.
Branching and Looping Examples, cont’d. Remember the generic triple jump world…
Simple Program Design Third Edition A Step-by-Step Approach
Alice Programming. alice.com Carnegie Mellon University with support from Electronic Arts, Sun Microsystems, DARPA, Intel, Microsoft, NSF and ONR. Alice.
Study Guide For Test Chapter 5, 6,& 7 Test is Friday, May 15th.
Intro to C++. Getting Started with Microsoft Visual Studios Open Microsoft Visual Studios 2010 Click on file Click on New Project Choose Visual C++ on.
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.
PIIT Computer Science Summer Camp - Alice July 9, 2012 Brenda Parker Computer Science Department MTSU.
Workshop Using Alice to Stimulate Learning in STEM July 7, 2008 Brenda Parker Computer Science Department MTSU.
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.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming First Edition.
Changing Color, Using Text Objects, and Random Selection in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2008.
CS329e – Elements of Visual Programming Implementing Programs Mike Scott (Slides 2-2)
Teaching a character to walk in more than one world: Parameters and Inheritance. By Lana Dyck under the direction of Professor Susan Rodger Duke University.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Flowcharts.
Top-Down Design and Modular Development. The process of developing methods for objects is mostly a process of developing algorithms; each method is an.
By Melissa Dalis Professor Susan Rodger Duke University June 2011 Multiplication Table.
A Simple Quiz: Ask User Functions. By Lana Dyck under the direction of Professor Susan Rodger Duke University June 2009, added Part 2 July 2011.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
Variables and Functions Chapter Variables Named storage location in computer’s memory Programs may need to store data when running Types of data.
Review for test! Alice Chapter 1&2 Test is tomorrow! - March 26 th March 25th.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4: Events Programming with Alice and Java First Edition by John Lewis.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
5 Event Handling Interactive Programming Suggested Reading Interaction: Events and Event Handling, Supplemental Text for CPSC 203 Distributed this term.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
Programming in Alice IT-IDT-9 Design, develop, test and implement programs using visual programming. 9.1 Utilize drag and drop software to develop programs.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 4-1 Lecture Objectives To understand: –what values can be stored in a Boolean.
Presenter: Carol Liss Timberlane Regional Middle School 6 th and 7 th grade Tech. Educator Co presenters:
1 Structured Programming Arab Academy for Science and Technology CC112 Dr. Sherif Mohamed Tawfik The Course.
An Introduction to Programming Using Alice 2.2, Second Edition Chapter 7 Recursive Algorithms.
Chapter 2: Programming in Alice
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Using Macros Lesson.
Beginning Animation. Storyboard An Invitation to Dinner 1.Marlin and Dory (two small fish) are swimming and talking. 2.A shark (Bruce) swims up behind.
1 Quiz Show Programming Terms. 2 Alice - 3D Virtual Programming Vocabulary Quiz Board Chapter 1 Chapter 2a Chapter 2b Chapter 3 Chapter 4 $100 $200 $300.
Development Environment
ICS 3UI - Introduction to Computer Science
A Simple Quiz for Alice 3.2:
Chapter 3: Variables, Functions, Math, and Strings
Chapter 3: Variables, Functions, Math, and Strings
Learning Java with Alice 3.0 Game Design Kathy Bierscheid
A Simple Quiz for Alice 3.2:
Chapter 2: Programming in Alice
Introduction to TouchDevelop
Design and Implementation
CSCI N207 Data Analysis Using Spreadsheet
Basic Concepts of Algorithm
Presentation transcript:

PIIT Computer Science Summer Camp - Alice July 10, 2012 Brenda Parker Computer Science Department MTSU

April 21, 2015Brenda Parker - Alice Workshop2 Welcome – Day 2 Demonstrate Alice Worlds Review Contest

April 21, 2015Brenda Parker - Alice Workshop3 Workshop Agenda Discuss how programmers develop programs (software) Apply the “software life” cycle to Alice Create “custom” methods for Alice Objects

April 21, 2015Brenda Parker - Alice Workshop4 Part I – Developing Software Programmers use the “Software Development Cycle” 1.Design Phase 2.Implementation Phase 3.Testing Phase 4.Debugging Phase

April 21, 2015Brenda Parker - Alice Workshop5 Developing Software Design Phase Programmers will learn about all specifications (what the program should do) Programmers will create a list of instructions needed to solve the problem Programmers will break complex methods down into a smaller methods called “modules”

April 21, 2015Brenda Parker - Alice Workshop6 Developing Software Design Phase In Alice, we should learn : 1.Which objects are needed? 2.Which methods are needed? 3.What does the first scene look like?

April 21, 2015Brenda Parker - Alice Workshop7 Developing Software Implementation Phase Programmers will use a programming language to enter instructions (coding) In Alice, we add and position objects and code methods for the objects

April 21, 2015Brenda Parker - Alice Workshop8 Developing Software Testing Phase Programmers will “test” the program to see if it works properly and meets its specifications. Testing involves testing each method to see if it works by itself and with other methods

Developing Software Debugging Phase Programmers will correct mistakes found in the Testing Phase In Alice, correct the design of each method and correct the initial state of the world April 21, 20159Brenda Parker - Alice Workshop

Good Programmers know the importance of DESIGN 1. Design their software carefully! 2.Use a “Modular” design break a large task down into smaller tasks called modules Each module performs one task In Alice, this is performed by creating “user defined methods” = “Custom World Methods”

Creating User Methods Why? 1.Makes Alice programs easier to debug 2.Makes Alice programs easier to create 3.Supports “modular” design Now, let’s learn to create our own methods! April 21, Brenda Parker - Alice Workshop

April 21, 2015Brenda Parker - Alice Workshop12 World Custom Methods Created by the user Used to break up large complex methods into smaller more manageable methods

Example Suppose we wish to create an “Ice Skater World” which opens with an introduction by the skater. Then, the skater skates around 2 cones and jumps in the air. At the end the skater says goodbye and the camera circles the skater.

Example We would break this task down into 3 separate tasks! 1.Opening Scene 2.Skating Scene 3.Closing Scene Therefore, we need to create these three methods!

Design Phase 1.Determine objects needed 1.Ice skater 2.2 cones 2.Determine methods 1.openingScene 2.skatingScene 3.closingScene

Design Phase 3.Describr beginning scene 1.Snow world 2.Class lake environment 3.Add and position objects 1.Red and green cones 2.Skater in the middle of the cones

Implementation Phase Open Alice Choose snow world add Class Lake Environment Add ice skater and two cones (red and green) as shown Save your world as iceSkate1.a2w

Implementation Phase (coding) Write code for your three methods –openingScene –skatingScene –closingScene

April 21, 2015Brenda Parker - Alice Workshop19 Custom World Method How to create and use Custom World Methods 1.Name the method 2.Write the method 3.Call the method (Tell Alice to execute the method)

April 21, 2015Brenda Parker - Alice Workshop20 Create your Methods 1.Name your method 1.Click on World in the Object Tree 2.Click on create new method in the World’s Details Panel 3.Name the method – openingScene Repeat above for the skatingScene and the closingScene methods

April 21, 2015Brenda Parker - Alice Workshop21 Custom World Method 2. Write the method Click on the world object in the object tree Click on methods Click edit to write the method

Testing Phase 1.Test each method to see if each method works as desired 2.Test to see if the methods work with other methods.

Testing Phase –Part 1 Test each method to see if it works. 1.Test the openingScene method 2.Play the video to see if it works. 3.If it doesn’t work properly, edit the method and replay.

Testing Phase – Part 1 Test all methods to see if they work properly.

Testing Phase – Part 2 Test methods to see if they work with other methods. 1.Open world.my first method 2.Click and drag your method names to the editor window as shown. 3.Make sure that world.my first method begins when the world starts.

April 21, 2015Brenda Parker - Alice Workshop26 Testing Phase - Part 2

Debugging Phase Developers should attempt to correct mistakes that have been found. During the debugging phase, developers may often find improvements that can be made.

Practice VII Questions 1.What is the difference between “primitive” methods and custom methods? 2. Give two reasons that custom methods are often used in Alice. 3. What is the name of the method that is executed when your animation first begins? 4. What are the three steps for creating custom world methods? 5.What does “call” the method mean? 6. How are custom methods “called”? 7. Name the 4 steps of the Software Development Cycle. April 21, Brenda Parker - Alice Workshop

April 21, 2015Brenda Parker - Alice Workshop29 Software Documentation Written text and visual material (chart) that describe computer software Good software requires good documentation. –Comments that appear in the program –Notes that appear while the program is running –Instruction manual supplied with the software

April 21, 2015Brenda Parker - Alice Workshop30 Alice Documentation Add “Comment Tiles” which Name the program (peguinsDance.a2w) Programmer’s Name Date Program details

April 21, 2015Brenda Parker - Alice Workshop31 Adding Comments 1.Drag a copy of the comment tile from the bottom of the Editor Area and drop it into the method.

April 21, 2015Brenda Parker - Alice Workshop32 Adding Comments 2. Click the phrase No comment and type in your information.

ACTIVITY Use the “software development cycle” and develop your own video. To receive points for this exercise, you should design your animation using the DAY 2 Assignment Sheet. Some ideas: 1)Create a story about dancing penguins 2)Create a story about space invaders 3)Create a story about trip to the moon

April 21, 2015Brenda Parker - Alice Workshop34 Practice VIII Choose 1 of the following. Be sure to add comments: 1.Page AL #1 Penguin Dance 2.Page AL #2 Airport Animation 3.Page AL #3 Ballerina Movements 4.Create your own story (must have a beginning, a middle and an end). Use primitive methods as well as your own methods.

Using Logic and Looping Structures Logic If –then– else If something is true do this else do this! April 21, Brenda Parker - Alice Workshop

LOGIC Example: Suppose we have two objects, Elvis and a cuckoo clock. Let’s ask the user if the user wants the Elvis to sing or does the user wish to see the cuckoo clock sound out 3 times! April 21, Brenda Parker - Alice Workshop

How do we allow the user to input a value? Asking the user for input while a program is running is called “interactive input”. How do we do this in Alice? April 21, Brenda Parker - Alice Workshop

User Input Example Suppose that we have a world with Elvis and a cuckoo clock. The program should ask, “Do you want Elvis to sing? If the user answers, “YES”, Elvis will sing. Otherwise, the cuckoo bird will sound out cuckoo 3 times. April 21, Brenda Parker - Alice Workshop

User Input Example 1 Create a world with the two objects. 2. Drag the If/Else Control Structure to the Editor Area. 3.Set the If condition to true 4.Select the world function called “ask user for yes or no” 5.Use the function in the “if else” structure. 6. Click Question=Yes or No? to add the question. April 21, Brenda Parker - Alice Workshop

User Input Example April 21, Brenda Parker - Alice Workshop

Better Example – User Defined Methods

Using Logic and Looping Structures Loop – statements that are executed repeatedly. Types of Loops While Loop For all in order For all together April 21, Brenda Parker - Alice Workshop

April 21, 2015Brenda Parker - Alice Workshop43 Looping Structures While Continue to repeat until a certain condition occurs. Example: Suppose that we have a penguin that we wish to continue to move toward a hole in the ice until he “almost” reaches the hole!

Looping Structures Loop Used to specify that a group of statements is to be repeated a set number of times April 21, Brenda Parker - Alice Workshop

Example Edit the elvisSing method so that the user is asked to input the number of times Elvis should sing. 1.Drag the loop structure to the beginning of the method and set to 1 time. 2.Drag the world function “ask the user for a number” and place in the 1 time slot 3.Choose other to ask appropriate question. 4.Drag methods to the loop structure

Loop Example

variables Variable – a name that refers to a piece of the program’s memory, in which a value can be stored, retrieved, and changed. In Alice, there are two kinds of variables –World variable – variables that can be used by all methods –Method variable – variable that can only be used in a method that creates it.

Method Variable 1.Click on “create new variable” 2.Indicate type of variable 1.Number 2.Boolean 3.Object 4.Other 3.Give the variable a name 4.Click on OK

Example Use the Elvis and cuckoo clock world and update the program so that you ask the user how many times the Elvis/cuckoo should sing. Use a variable called numberOfTimes (camelCase)

Using Variable in a Loop 1.Edit the method to contain the variable 2.Click create new variable called numberOfTimes 3.Drag variable to beginning of method and set value to expressions – numberOfTimes 4.Drag World function “ask user for a number” and place in set value to and add “How many times should the cuckoo sing?” 5.Drag loop and set expression to numberOfTimes 6.Drag needed methods into the loop structure

Practice IX Create an Alice project called yourLastNameDay2.a2w which meets the following requirements. 1.Uses at least 3 user-defined methods 2.Uses at least 1 variable 3.Requires user input 4.Tells an “interesting” story 5.Uses if/else structure 6.Contains a loop or while structure 7.Contains proper documentation 8.Print your program 9.Submit your program to the Day 2 folder April 21, Brenda Parker - Alice Workshop