Other Variable Types Dim lab as String makes a box that can store a label tag Dim ColHead As String ColHead = “function” ColHead function Dim lab as Boolean.

Slides:



Advertisements
Similar presentations
Etter/Ingber Arrays and Matrices. Etter/Ingber One-Dimensional Arrays 4 An array is an indexed data structure 4 All variables stored in an array are of.
Advertisements

Ch. 3 Variables VB.Net Programming. Data Types Boolean – True or False values Short – Small integers (+/- 32,767) Integer – Medium-size integers (+/-
Chapter 2 Review Questions
Variables and Constants
CIS 234: Using Data in Java Thanks to Dr. Ralph D. Westfall.
PHYS 2020 Making Choices; Arrays. Arrays  An array is very much like a matrix.  In the C language, an array is a collection of variables, all of the.
Visual Basic: An Object Oriented Approach 3 – Making Objects Work.
Data Types and Operations Programming Fundamentals (Writing Code)Programming Fundamentals (Writing Code)
VBA & Excel Barry L. Nelson IEMS 465 Fall Quarter 2003.
Data Types. Every program must deal with data The data is usually described as a certain type This type determines what you can do with the data and how.
A Level Computing#BristolMet Session Objectives U2#S6 MUST identify different data types used in programming aka variable types SHOULD describe each data.
Saeed Ghanbartehrani Summer 2015 Lecture Notes #4: Working with Variables and User Interfaces IE 212: Computational Methods for Industrial Engineering.
U SING V ARIABLES IN V ISUAL B ASIC Intermediate 2 Software Development.
Class 3 Programming in Visual Basic. Class Objectives Learn about input/output Learn about strings Learn about subroutines Learn about arrays Learn about.
08/10/ Iteration Loops For … To … Next. 208/10/2015 Learning Objectives Define a program loop. State when a loop will end. State when the For.
Lab 01 Forms in excel Tahani ALdweesh Insert form into your project. 2. Change form’s properties. 3. Put controls on the form. 4. Change controls’
VB Arrays Chapter 8 Dr. John P. Abraham Professor UTPA.
Types and Loops.
3 - Variables Lingma Acheson Department of Computer and Information Science, IUPUI CSCI N331 VB.NET Programming.
Arrays and ArrayLists in Java L. Kedigh. Array Characteristics List of values. A list of values where every member is of the same type. Each member in.
Array Cs212: DataStructures Lab 2. Array Group of contiguous memory locations Each memory location has same name Each memory location has same type a.
Data & Data Types & Simple Math Operation 1 Data and Data Type Standard I/O Simple Math operation.
Primitive Variables.
Arrays “Array, I'm bound array, 'cross the wide Missouri.” ‒ Old Programmer’s Folk Song © Copyright 2014, Fred McClurg All Rights Reserved.
Computer Engineering 1 st Semester Dr. Rabie A. Ramadan 3.
Data Types and Variables. Data Type! Computers are all about Data! Data can be in the form of Text Dates Sounds Pictures.
6c – Function Procedures Lingma Acheson Department of Computer and Information Science, IUPUI CSCI N331 VB.NET Programming.
Python Arrays. An array is a variable that stores a collection of things, like a list. For example a list of peoples names. We can access the different.
Overview of VBA Programming & Syntax. Programming With Objects u Objects –Properties: attributes or characteristics of an object (e.g., font size, color,
C++ Basics. Compilation What does compilation do? g++ hello.cpp g++ -o hello.cpp hello.
Lab 6 (2) Arrays ► Lab 5 (1) Exercise Review ► Array Concept ► Why Arrays? ► Array Declaration ► An Example of Array ► Exercise.
Review TEST 2 Chapters 4,5,7. QUESTION For which type of operands does the == operator always work correctly: (a) int, (b) double, or (c) String?
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
1 More data types Character and String –Non-numeric variables –Examples: char orange; String something; –orange and something are variable names –Note.
© Leong Hon Wai, LeongHW, SoC, NUS (UIT2201: Algorithms) Page 1 Animation of Algorithm Goal: To understand an algorithm by animating its execution,
Hungarian Notation A must in this course Every object used MUST be renamed including the form(s) using the following rules Form  frmFormName E.g. frmTemperature.
CSI 3125, Preliminaries, page 1 Data Type, Variables.
31/01/ Selection If selection construct.
Chapter 8 P 1 Arrays and Grids Single-dimension arrays Definition An array is a sequence of elements all referred to with a common name. Other terms: table,
Chapter 61 Example : For … To… Step For index = 0 To n Step s lstValues.Items.Add(index) Next Control variable Start value Stop value Amount to add to.
A: A: double “4” A: “34” 4.
Slide 1 Controls v Control naming convention –Label: lblName –Command Button: cmdName –Text Box: txtName.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Student Grades Application Introducing Two-Dimensional Arrays and RadioButton.
 Variables can store data of different types, and different data types can do different things.  PHP supports the following data types:  String  Integer.
DATA TYPES, VARIABLES AND CONSTANTS. LEARNING OBJECTIVES  Be able to identify and explain the difference between data and information  Be able to identify,
情報基礎 A Lecture 9 Takeshi Tokuyama ・ Jinhee Chun Tohoku University Graduate School of Information Sciences System Information Sciences Design and Analysis.
Data Handling in Algorithms. Activity 1 Starter Task: Quickly complete the sheet 5mins!
Adding Code to the Option Button. Open VB 1.Double click the Calculate button and select General from the Object list box. 2.Add the following code to.
Arrays What is an array… –A data structure that holds a set of homogenous elements (of the same type) –Associate a set of numbers with a single variable.
A Sample Program #include using namespace std; int main(void) { cout
Making Interactive Programs with Visual Basic .NET
Visual Basic Declaring Variables Dim x as Integer = 0 In the statement above, x is being declared as an Integer (whole number) and is initialised.
Chapter 6 Controlling Program Flow with Looping Structures.
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
Fundamentals 2.
IGCSE 4 Cambridge Data types and arrays Computer Science Section 2
Repetition – For and Do While
Starter Question In your jotter write the pseudocode to take in two numbers, add them together then display the answer. Declare variables RECEIVE firstNumber.
2. Understanding VB Variables
Review Operation Bingo
مراجعة الحاسب.
حلقات التكرار.
البرمجة بلغة فيجول بيسك ستوديو
CS100J 26 April. Matlab Use help button!!! Variables, values, types
Numbers.
Chapter 2: Java Fundamentals
Data Types List Box Combo Box Checkbox Option Box Visual Basic 6.0
JavaScript.
Language Constructs Construct means to build or put together. Language constructs refers to those parts which make up a high level programming language.
Variables and Constants
Presentation transcript:

Other Variable Types Dim lab as String makes a box that can store a label tag Dim ColHead As String ColHead = “function” ColHead function Dim lab as Boolean makes a box that can store TRUE or FALSE Dim Test As Boolean Test=(5>3) Test TRUE Dim A(-2 to 2, 3 to 5) As Single makes an ARRAY of boxes indexed as This is box A(-1,5) The Statement A(-1,5)=7.3 Puts the value 7.3 in the Computer Box Labeled A(-1,5) 5.7 Arrays can contain any type

Number Variables in VBA Dim N as Integer N Makes a box in the Computer storage called N – Can only store Integers to Dim N as Long will allow for integers up to 2 billion Dim A as Single A Makes a box in the Computer storage called A – Uses 32 bits precision Dim N as Double give 64 bits precision Always declare variables in a VBA program; Declare Variables with the Dim statement When you declared a variable imagine the labeling of a box in the computer storaage Rules The statement: A = 7.6 puts the value 7.6 into the box A7.6 The statement: N = 5 puts the value 5 into the box N The statement: B = 5.3 puts the value 5.3 into the box B 5.3 Assuming that B has been declared as Dim B as Single 5 The statement: N = 5.7 puts the value 6 into box N 6 The statement: A = B puts the value 5.3 into the box A Leaves box B 5.3 With the statement: A = A+1 The computer calculates the RHS FIRST--- Takes Current value of A(5.3) Adds 1 (6.3) drops result in box A— This overwrites the value in box A 6.3 A The old value of A can not be Retrieved.

For Loops For I =1 to 3 P=I+1 Next I P=2 P=3 P=4 For I =1 to 5 Step 2 P=I+1 Next I P=2 P=4 P=6 For I =5 to 1 Step -2 P=I+1 Next I P=6 P=4 P=2

For I =1 to For J = I to 2*I P=I*J Next J Next I P=1 P=2 P=6 P=4 P=8 P=12 P=9 P=15 P=18