Class 2 Remote Instruction Introduction to Variables EDU 556 Programming for Instruction Dr. Steve Broskoske This is an audio PowerCast. Make sure your.

Slides:



Advertisements
Similar presentations
Chapter 3: Using Variables and Constants
Advertisements

Introduction to Computing Concepts Note Set 7. Overview Variables Data Types Basic Arithmetic Expressions ▫ Arithmetic.
Objective: Dealing with data in C++ Agenda: Notes Essay Help.
Advanced PowerPoint Techniques and Introduction to VBA Coding Dr. Steve Broskoske Misericordia University EDU 533 Computer-based Education.
String Variables Visual Basic for Applications 4.
CVEV 118/698 Visual Basic Lecture 1 Prof. Mounir Mabsout Expert 1: Elsa Sulukdjian Expert 2: Walid El Asmar.
An Introduction to Programming with C++ Fifth Edition Chapter 4 Chapter 4: Variables, Constants, and Arithmetic Operators.
An Introduction to Programming with C++ Fifth Edition Chapter 4 Chapter 4: Variables, Constants, and Arithmetic Operators.
Data Types and Operations Programming Fundamentals (Writing Code)Programming Fundamentals (Writing Code)
Chapter 1 Program Design
VB Code Statements 3 types of VB statement The Remark statement, known as comments, are used for project documentation only Begin with an apostrophe Not.
To type the VB code behind the command button (named cmdPush), Double-Click on the Push Me (caption) command button As a result the Visual Basic Code Window.
Chapter Three Using Variables and Constants Programming with Microsoft Visual Basic th Edition.
Creating Embedded Formative Assessment Dr. Steve Broskoske Misericordia University EDU 533 Computer-based Education.
PHP : Hypertext Preprocessor
Programming with Microsoft Visual Basic th Edition CHAPTER THREE USING VARIABLES AND CONSTANTS.
An Introduction to Textual Programming
06/10/ Working with Data. 206/10/2015 Learning Objectives Explain the circumstances when the following might be useful: Disabling buttons and.
National Diploma Unit 4 Introduction to Software Development Data types, variables and constants.
Section 2 Variables National 4/5 Scratch Course. What you should know after this lesson What a variable is Where variables are stored How to get data.
Java Data Types. Primitive Data Types Java has 8 primitive data types: – char: used to store a single character eg. G – boolean: used to store true or.
Access VBA Programming for Beginners - Class 2 - by Patrick Lasu
Representing Data: Constants and Variables CHAPTER THREE Matakuliah: T0063 – Pemrograman Visual Tahun: 2009.
Class 1 Remote Instruction More with Forms and Controls EDU 556 Programming for Instruction Dr. Steve Broskoske This is an audio PowerCast. Make sure.
Class 3 Remote Instruction Decision Structures and Global Variables EDU 556 Programming for Instruction Dr. Steve Broskoske This is an audio PowerCast.
Remote Instruction: Teaching with Visual Basic EDU 556 Programming for Instruction Dr. Steve Broskoske This is an audio PowerCast. Make sure your volume.
CS0004: Introduction to Programming Project 1 – Lessons Learned.
Variables and Math in Code. Variables A variable is a storage block for information in your program “A” “A” Computer Program Memory Computer Program.
Class 3 Remote Instruction Computer Math EDU 556 Programming for Instruction Dr. Steve Broskoske This is an audio PowerCast. Make sure your volume is.
PROGRAMMING In Lesson 2. STARTER ACTIVITY Complete the starter activity in your python folder – lesson 2 Now we will see how you got on and update your.
Data Types and Variables. Data Type! Computers are all about Data! Data can be in the form of Text Dates Sounds Pictures.
Variables and Data Types Data (information we're going to store) – Numbers – Text – Dates What types of data can JavaScript process? How do we store it?
Class 2 Remote Instruction Review of Working with Buttons EDU 556 Programming for Instruction Dr. Steve Broskoske This is an audio PowerCast. Make sure.
Chapter 3 Control Structures. The If…Then Statement The If…Then statement is a Decision statement = that executes a set of statements when a condition.
ITEC 109 Lecture 7 Operations. Review Variables / Methods Functions Assignments –Purpose? –What provides the data? –What stores the data? –What type of.
Data Tonga Institute of Higher Education. Variables Programs need to remember values.  Example: A program that keeps track of sales needs to remember.
Pay Example (PFirst98) Please use speaker notes for additional information!
Variables and Functions ROBOTC Software © 2012 Project Lead The Way, Inc.Principles of Engineering.
Programming with Microsoft Visual Basic th Edition
Tutorial 3: Using Variables and Constants1 Tutorial 3 Using Variables and Constants.
Programming Paradigms By Tyler Smith. Event Driven Event driven paradigm means that the program executes code in reaction to events. The limitation of.
Computer Science I Storing data. Binary numbers. Classwork/homework: Catch up. Do analysis of image types.
Variables Hold information that may be manipulated, used to manipulate other information or remembered for later use A storage location in memory (RAM)
Variables in VB.NET. Variables  A storage location in memory (RAM)  Holds data/information while the program is running  These storage locations can.
31/01/ Selection If selection construct.
Variables Continued In the last session we saw how variables are objects that allow us to store values in the RAM of the computer In this session we shall.
Variables and Strings. Variables  When we are writing programs, we will frequently have to remember a value for later use  We will want to give this.
Variables in VB. What is a variable? ► A named memory location that stores a value.
DATA TYPES, VARIABLES AND CONSTANTS. LEARNING OBJECTIVES  Be able to identify and explain the difference between data and information  Be able to identify,
PHP Form Processing * referenced from
Addison Wesley is an imprint of © 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 3 Variables and Calculations.
Making Interactive Programs with Visual Basic .NET
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.
What will each of the following lines print? System.out.println("number" ); number645 System.out.println("number" + (6 + 4)+ 5); number105 System.out.println(6.
Input, Output and Variables GCSE Computer Science – Python.
Data Types Mr Tottman Link. Data Types Programs need to use data for calculations and for output to various devices The best programs will always use.
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
Visual Basic Fundamental Concepts
Unit 2 Technology Systems
Chapter 4 The If…Then Statement
Clearly Visual Basic: Programming with Visual Basic nd Edition
Starter Question In your jotter write the pseudocode to take in two numbers, add them together then display the answer. Declare variables RECEIVE firstNumber.
Chapter (3) - Looping Questions.
We are starting JavaScript. Here are a set of examples
Language Constructs Construct means to build or put together. Language constructs refers to those parts which make up a high level programming language.
7 – Variables, Input and Output
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.
Data Types and Maths Programming Guides.
An Introduction to Programming
Variables and Constants
Presentation transcript:

Class 2 Remote Instruction Introduction to Variables EDU 556 Programming for Instruction Dr. Steve Broskoske This is an audio PowerCast. Make sure your volume is turned up, and press F5 to begin. Click to advance as usual.

Introduction to Variables On a calculator, it is many times helpful to store some information temporarily in a memory. In programming, a “memory” is known as a variable. A variable can store numeric information or a “string” (text).

Difference Between Calculator Memory and Variables Calculator Memory: Most calculators have only 1 memory. Memory actions: – Add, clear, remember. Can store only a number. Variables: Can have an unlimited number of variables. Variable actions: – Add, clear, remember. Can store integers (whole numbers), fractional numbers, text, true/false.

Common Variable Types Data TypeDescriptionRange Integer16-bit integer to Long32-bit integer±2 billion (10 9 ) Single16-bit floating-point value±3.4 x Double32-bit floating-point value±1.8 x Stringcharacters/textup to 2 billion characters Booleantrue or falsefalse, true Whole numbers (integers). Decimal numbers. “String” refers to text. “Boolean” refers to true/false. Programmers select specific data types to increase storage efficiency and to restrict type of data stored.

Declaring a Variable “Declaring” a variable means that you establish it in PC memory. Variables can be declared in 3 different places, depending on how long the memory has to function: – Only needs to function within one event procedure. – Shared by more than one control on a form. – Needs to be shared by controls on more than the current form.

Where to Declare a Variable Only needs to function within one event procedure. – Variable only needs to exist in the coding for one button. Declare the variable within the subroutine/procedure. Needs to be shared by more than one control on a form. – Pressing one button will store info. in a variable, and pressing another button will recall the info. stored in the variable. Needs to be shared by controls on more than the current form. – Info. is collected from the user on one form, and then processed on another form. Example is calculating a student’s quiz score from questions on several forms.

To Declare a Variable Determine the type of data the variable will hold. – Integer (whole no.) or single (decimal). – String (text). – Boolean (true or false). Decide how the variable needs to function. – Within 1 event procedure/subroutine. – Within several event procedures on one form. – Over several forms. Declare the variable.

To Declare a Variable Dim n As Integer Dim myNumber As Single Dim HighNum, LowNum As Integer Dim myName As String Dim firstName, lastName As String Dim Answer As Boolean Dim variable_name As data_type

To Declare a Variable Dim n As Integer, myName As String Dim a, b, c, n As Integer, total As Long Dim flag As Boolean Dim variable_name As data_type Notice how many variables can be declared in 1 line of text in programming.

Storing a Value in a Variable n = 5 myNumber = myName = “Dr. Steve” sentence = “This is my sentence. Or two.” flag = True variable_name = some information x = some value (in Algebra)

Concatenation Notice that text, numbers, and true/false info. are all stored in different types of variables. To combine these together, you must use the & (ampersand) character. & (string concatenation character) allows you to combine strings (text) with other variable types (numbers or Boolean).

Concatentation Declare several variables: – Dim smallWords, medWords, longWords As string Set values for variables: – smallWords = “Hello.” – medWords = “My name is Lisa.” Blend (concatenate) strings: – longWords = smallWords & medWords Variable longWords now holds in memory: – Hello. My name is Lisa.

Concatenation Declare several variables: – Dim age As Integer, maxcount As Integer, s As string Set values for variables: – age = 5 maxcount = 100 s = “I am ” & age & “years old. I can count to ” & maxcount Variable s now holds in memory: – I am 5 years old. I can count to 100.

Power of Variables Dr. Steve Enter your name: Dim StudentName As String StudentName = txtEnterName.text lblShowName.text = StudentName lblInstructions Dr. Steve lblShowName txtEnterName

Next Class Please review this material. If you enter our next class with a basic understanding of variables and their uses, this will save us about an hour of orientation. At our next class, we will review these concepts and proceed directly to using them in coding.