Programming with App Inventor Computing Institute for K-12 Teachers Summer 2012 Workshop.

Slides:



Advertisements
Similar presentations
Teacher Functions. Teacher Functions in OAS Create Tests Assign Tests to a Class View Reports of Student Performance.
Advertisements

Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
Programming with App Inventor Computing Institute for K-12 Teachers Summer 2012 Workshop.
CPSC 388 – Compiler Design and Construction
Programming with App Inventor Computing Institute for K-12 Teachers Summer 2012 Workshop.
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
Collin College Excel Exam Review. True In Excel worksheets, rows are designated using numbers while columns are designated using letters.
VBA for MS Excel Hamze Msheik. Open the Visual Basic Editor in Excel 2007 Click on the Microsoft Office button in the top left of the Excel window and.
靜宜大學資管系 楊子青 1 Programming Your App’s Memory 靜宜大學資管系 楊子青
Primitive Data Types There are a number of common objects we encounter and are treated specially by almost any programming language These are called basic.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
Guide To UNIX Using Linux Third Edition
CSC 160 Computer Programming for Non-Majors Lecture #3a: Stepper, Words, Sentences Prof. Adam M. Wittenstein
Microsoft Office © Copyright William Rowan Objective By the end of this you will have being given a brief introduction to: Microsoft Word Microsoft.
Programming with App Inventor Computing Institute for K-12 Teachers Summer 2012 Workshop.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
Line up By Melissa Dalis Professor Susan Rodger Duke University June 2011.
Mathcad Variable Names A string of characters (including numbers and some “special” characters (e.g. #, %, _, and a few more) Cannot start with a number.
Introduction to TouchDevelop
XP New Perspectives on Microsoft Office Access 2003 Tutorial 11 1 Microsoft Office Access 2003 Tutorial 11 – Using and Writing Visual Basic for Applications.
Tutorial 11 Using and Writing Visual Basic for Applications Code
Enhancing User Interaction Through Programming
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
CHAPTER THREE Representing Data: Constants and Variables.
1 Introduction to Javascript Peter Atkinson. 2 Objectives To understand and use appropriately some of the basic elements of Javascript: –alert and prompt.
Microsoft® Excel Use Insert Function. 1 Key and point to enter functions. 2 Navigate with and create named ranges. 3 Use range names in functions.
Programming with App Inventor Computing Institute for K-12 Teachers Summer 2012 Workshop.
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
Nonvisual Arrays and Recursion by Chris Brown under Prof. Susan Rodger Duke University June 2012.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Java Script: Arrays (Chapter 11 in [2]). 2 Outline Introduction Introduction Arrays Arrays Declaring and Allocating Arrays Declaring and Allocating Arrays.
Introduction to Programming with RAPTOR
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Variables, Functions and Events (there is an audio component to this eLesson) © Dr.
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.
CONTENTS Processing structures and commands Control structures – Sequence Sequence – Selection Selection – Iteration Iteration Naming conventions – File.
Datatypes, Variables, Constants Flash Class. What Does ActionScript Do? Automates Examples: – Tells animation what to do button is clicked – Turn off.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
Variables in Java x = 3;. What is a variable?  A variable is a placeholder in memory used by programmers to store information for a certain amount of.
Programming with App Inventor Computing Institute for K-12 Teachers Summer 2012 Workshop.
Variables and Functions Chapter Variables Named storage location in computer’s memory Programs may need to store data when running Types of data.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
Programming with Microsoft Visual Basic th Edition
Teacher Functions. Teacher Functions in OAS Create Tests Assign Tests to a Class View Reports of Student Performance.
JavaScript. JavaScript Introduction JavaScript is the world's most popular programming language. It is the language for HTML and the web, for servers,
CHAPTER THREE Representing Data: Constants and Variables.
Controlling Program Flow with Decision Structures.
Visual Basic Review LBS 126. VB programming Project Form 1Form 2Form 3 Text boxButton Picture box Objects Text box Button Objects.
Visual Basic.NET Programming for the Rest of Us Keith Mulbery Utah Valley State College.
Introduction to TouchDevelop Lesson 3 – Comments & Lists Created by S. Johnson
Introduction to Javascript. What is javascript?  The most popular web scripting language in the world  Used to produce rich thin client web applications.
Chapter 4.  Variables – named memory location that stores a value.  Variables allows the use of meaningful names which makes the code easier to read.
Input, Variables, and Calculations. The TextBox Component Performing Calculations Storing Data with Variables Creating Blocks with Typeblocking The Slider.
Representing Data: Constants and Variables
Unit 2 Technology Systems
Test 2 Review Outline.
A Simple Quiz for Alice 3.2:
Visual Basic 6 (VB6) Data Types, And Operators
MS-Excel Part 1.
Variables and Arithmetic Operations
Learning Objective LO: We’re learning to understand when it is appropriate to use particular data types.
Teacher Functions.
Introduction to TouchDevelop
Lecture Set 3 Introduction to Visual Basic Concepts
A Simple Quiz for Alice 3.2:
Introduction to TouchDevelop
Programming Lists of Data 靜宜大學資管系 楊子青
YOUR text YOUR text YOUR text YOUR text
Data Types Every variable has a given data type. The most common data types are: String - Text made up of numbers, letters and characters. Integer - Whole.
Web Programming and Design
Presentation transcript:

Programming with App Inventor Computing Institute for K-12 Teachers Summer 2012 Workshop

Variables Session SA-1

Introduction to Variables Variables are used in every aspect of programming. They are used to store data the programmer needs later in the program. In the App Inventor, a variable can store most any data. In this workshop the following 3 data types will be covered. Numbers – A number variable can contain almost any value. (e.g. 1, 0.01, -5,+/- 10 million if not more) String (text) – A string variable can contain letters, words, numbers, symbols, punctuation or sentences.(e.g. “s”, “string”, “This is still a string”, “sessionSA-0”) Boolean – A Boolean variable contains a true or false value.

Introduction to Variables In the Blocks Editor, you may create a variable by clicking on the Built-In tab on the left and then selecting Definition. (know as the Built-In Definitions) This will give you the option of creating a variable (as well as Procedure, Procedure Argument Names or a dummy stub – which will be explained later) This is the block for a variable: The App Inventor will create a unique default name for the variable (which you may change) and add the variable to your My Blocks, My Definitions. These are your defined variables and procedures. To change the value of the variable, click on My Definitions and select the set global block for your variable. All variables are global in scope, meaning they can be accessed from anywhere in your program.

Introduction to Variables This shows the blocks the may be added from the Definition drawer under the Built-In Tab. Variables and Procedures are added from here. Procedure(s) will be covered later. Just click and drag.

Introduction to Variables This shows where several variables have been added to a project and then renamed to varShowFirst (Boolean set to True), varFirstName (String set to George), varAge (Number set to 57), etc. You cannot create two variables with the same name. Boolean String Number

Introduction to Variables Once you add variables to you project, those variables and associated will be shown when clicking on the My Blocks, then My Definitions drawer in the Blocks Editor. For each variable two blocks are created, an assignment block and a set to block to change the variable’s value. assignment block set to block

Introduction to Variables Variables can be used to manipulate data. Number variables can be summed or multiplied. Strings can be joined, searched and formatted. Errors will arise if trying to multiply a number by a string, for example. When using a predefined function, the App Inventor will not allow type mismatches like this. Variables can be used in any of the App Inventor Built-In functions shown in the Block Editor. The functions are used to manipulate strings, numbers and Booleans (and also elements of a list that are of these three types). Numbers can be referenced as number or as a string and will be treated accordingly by their use.

Project SA-1 – Variables Create an app that changes the contents of two different kinds of variables using a button click event to trigger the change.