SlideServe
Menu
Préférences
© SlideServe · v2026

Introduction to Variables in App Inventor: A K-12 Teacher Workshop Overview

catori avatar
9 diapositives · 244 Views · Jul 27, 2014

This workshop focuses on the essential concept of variables in programming using App Inventor. Participants will learn about three key data types: Numbers, Strings, and Booleans, understanding how they store and manipulate data. We cover the creation and management of variables in the Blocks Editor, including assigning global scope, and how to implement them effectively in app development. By the end of the session, educators will be equipped to create interactive applications that utilize variables based on user-triggered events.

Introduction to Variables in App Inventor: A K-12 Teacher Workshop Overview - slide 1
01 / 9Introduction to Variables in App Inventor: A K-12 Teacher Workshop Overview
1 / 17

Télécharger la présentation

Introduction to Variables in App Inventor: A K-12 Teacher Workshop Overview
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Programming with App Inventor Computing Institute for K-12 Teachers Summer 2012 Workshop

  2. VariablesSession SA-1

  3. 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.

  4. 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 MyDefinitions 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.

  5. 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.

  6. 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

  7. 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

  8. 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.

  9. 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.