Programming Logic Program Design. Objectives Steps in program development Algorithms and Pseudocode Data Activity: Alice program.

Slides:



Advertisements
Similar presentations
Introduction to Macromedia Director 8.5 – Lingo
Advertisements

CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
Tutorial 12: Enhancing Excel with Visual Basic for Applications
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
ITEC113 Algorithms and Programming Techniques
Creating Custom Forms. 2 Design and create a custom form You can create a custom form by modifying an existing form or creating a new form. Either way,
Chapter 2: Algorithm Discovery and Design
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Program Design and Development
Lecture Notes 1/21/04 Program Design & Intro to Algorithms.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Classes, Objects, and World-level Methods Alice. Programming in Alice© 2006 Dr. Tim Margush2 Class / Object Class A template describing the characteristics.
Chapter 1 Program Design
Lecture Notes 8/30/05 Program Design & Intro to Algorithms.
Moving To Code 3 More on the Problem-Solving Process §The final step in the problem-solving process is to evaluate and modify (if necessary) the program.
Chapter 2: Algorithm Discovery and Design
Chapter 2: Algorithm Discovery and Design
Adding Automated Functionality to Office Applications.
Introduction to Alice Alice is named in honor of Lewis Carroll’s Alice in Wonderland.
Microsoft ® Office Word 2007 Training Mail Merge II: Use the Ribbon and perform a complex mail merge [Your company name] presents:
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
01-Intro-Object-Oriented-Prog-Alice1 Barb Ericson Georgia Institute of Technology Aug 2009 Introduction to Object-Oriented Programming in Alice.
DCT 1123 Problem Solving & Algorithms
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
© The McGraw-Hill Companies, 2006 Chapter 1 The first step.
A First Program Using C#
Simple Program Design Third Edition A Step-by-Step Approach
Copyright 2007, Paradigm Publishing Inc. EXCEL 2007 Chapter 7 BACKNEXTEND 7-1 LINKS TO OBJECTIVES Record & run a macro Record & run a macro Save as a macro-
Chapter 2: Algorithm Discovery and Design Invitation to Computer Science, C++ Version, Third Edition.
Invitation to Computer Science, Java Version, Second Edition.
1 Data List Spreadsheets or simple databases - a different use of Spreadsheets Bent Thomsen.
Nonvisual Arrays and Recursion by Chris Brown under Prof. Susan Rodger Duke University June 2012.
Alice 2.0 Introductory Concepts and Techniques Project 1 Exploring Alice and Object-Oriented Programming.
Tutorial 10 Programming with JavaScript
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming First Edition.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Program Design and Coding
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
CS329e – Elements of Visual Programming Implementing Programs Mike Scott (Slides 2-2)
Chapter 1 Creating a Dreamweaver Web Page and Local Site
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
Chapter 1 Program design Objectives To describe the steps in the program development process To introduce the current program design methodology To introduce.
Introduction to Alice Alice is named in honor of Lewis Carroll’s Alice in Wonderland Slides Credit: Joel Adams, Alice in Action CS120 Lecture August,
CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.
XP Tutorial 8 Adding Interactivity with ActionScript.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Working with Data Lists.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter Ten Structures and Sequential Access Files.
Methods (part 1) Alice In Action, Ch 2 Slides Credit: Joel Adams, Alice in Action CS120 Lecture August 2012.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 6 1 Microsoft Office Access 2003 Tutorial 6 – Creating Custom Forms.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
Alice in Action with Java Chapter 1 Getting Started with Alice.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
COMPREHENSIVE Excel Tutorial 12 Expanding Excel with Visual Basic for Applications.
Alice in Action with Java Chapter 2 Methods. Alice in Action with Java2 Objectives Build world-level methods to help organize a story into scenes and.
Chapter 2: The Visual Studio .NET Development Environment
An Introduction to Computers and Visual Basic
Programming Logic Alice.
Classes, Objects, and World-level Methods
Program Design Introduction to Computer Programming By:
Using Objects in Alice.
Alice in Action with Java
Making Procedural Methods
An Introduction to Computers and Visual Basic
Introduction to Object-Oriented Programming in Alice
Introduction to Data Structure
Presentation transcript:

Programming Logic Program Design

Objectives Steps in program development Algorithms and Pseudocode Data Activity: Alice program

Programming Development of a solution to an identified problem, and the setting up of a related series of instructions that, when directed through computer hardware, will produce the desired results.

Steps in development of a program 1.Define the problem 2.Outline the solution 3.Develop outline into algorithm 4.Test the algorithm 5.Code in a programming language 6.Run the program 7.Document the program

Algorithm Simple terms: a recipe Set of detailed, unambiguous and ordered instructions to produce desired output from a given input. Simple English

Pseudocode Ways to represent algorithms Concentrate on logic Conventions: –Use simple English –Separate lines –Keywords, indentation to signify control structure –Top to bottom

Keywords Receive information –Read: input from file or record –Get: user input Output –Print: output to printer –Write: written to file –Display/Put: to screen

Program Data Variable: store a particular data item –Character, integer –Value changes Constant: data item that remain same Data Types: 1.Integer 3, -5, Character –‘A’, ‘b’, ‘$’ 3.Boolean –True or false –Control flag

Program data (Continued) Data Structures –Data items or/and data structure 1.Record: data items with relationship to one another Student record 2.File: collection of related records. –Student file 3.Array: data structure made up of data items with same data type and are accessed by same name –Student scores 4.String: collection of characters, fixed or variable –Student name

Class, Object, Method Class: –the abstract characteristics of a thing –White Rabbit Object: –A particular instance of the class –A single rabbit Method: –An object’s abilities or behaviors –Turning the rabbit’s head

Programming Implementation in Alice

Program Style Change program display styles in Preferences How to access Preferences dialog box –Click the Edit menu –Click the Preferences choice Selecting a display style in Preferences dialog –Click next to “display my program” in General tab –Select a style Style recommended for course: Java Style in Color

Program Style (continued)

Adding Objects to Alice Class: blueprint for an object How to populate Alice world with objects –Click Add Objects button in world window –Locate class specifying the object in the Alice Gallery –Right-click class and select “Add instance to world” Objects in sample world: aliceLiddell and whiteRabbit Naming conventions for objects and classes –Class: capitalize all words; e.g., AliceLiddell –Object: capitalize all but first word; e.g., aliceLiddell Objects can be renamed from the object tree

Adding Objects to Alice (continued)

Accessing Object Subparts Bounding box: encloses any Alice object Impact of selecting an object in the object tree –Bounding box is drawn around object in world window –Details area adapts to the selected object First action to program: Alice turns head to user First set of programming steps –Select + sign next to aliceLiddell in object tree –Select + sign next to neck subpart –Select head (bounding box is drawn, details change) –Drag doInOrder control to top of editing window

Accessing Object Subparts (continued)

Sending Messages Programs rely on sending messages to objects Method: behavior-producing message Programming Alice’s head to turn –Select Alice Liddell’s head in the object tree –Scan through the methods in the details area –Click on pointAt() –Drag pointAt() to the editing area and drop it –Specify camera as the target

Sending Messages (continued)

Testing and Debugging Bug: error interfering with normal program functions Debugging: process of removing program bugs Click the Play button to test Alice Liddell application –Alice Liddell’s head will turn toward the user

Testing and Debugging (continued)

Coding the Other Actions say() message –Displays dialog for an object –Text can be customized by selecting other… Task: complete first Alice Liddell application –Add Alice Liddell’s initial greeting –Point the white rabbit to the user –Have Alice Liddell introduce herself –Have the white rabbit introduce himself Customize messages by selecting from more… –Example: adjust fontSize of message text to 30

Coding the Other Actions (continued)

Statements Statement: a line or control structure in a program Computer program is a collection of statements Basic format of a line in a program –object.message(value); more... Control structures manage other statements –Example: doInOrder contains other statements

The Final Action Sequential execution –Actions are performed consecutively –Example: actions executed in doInOrder structures Simultaneous execution –Actions are performed in parallel –Example: actions performed in doTogether structure Finishing the first program –Add doTogether control structure to application –Send say( )to aliceLiddell and whiteRabbit –Message value: Welcome to our world

The Final Action (continued)

Final Testing First set of actions are performed separately Final actions are performed simultaneously

Final Testing (continued)

Questions