Developing Software Applications Introduction to Variables & Data Types in VB State Transition Diagrams.

Slides:



Advertisements
Similar presentations
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
Advertisements

Lecture Set 4 Data Types and Variables Part B – Variables, Constants, Expressions Conversion Rules Options Strict, Option Explicit Scope of Definition.
©2004 Brooks/Cole Chapter 2 Variables, Values and Operations.
IS 1181 IS 118 Introduction to Development Tools VB Chapter 04.
Developing Software Applications Introduction to Programming Fundamentals Scoping in VB Simple Ifs in VB.
IS437: Fall 2004 Instructor: Dr. Boris Jukic Data Types, Constants, Variables, Scope, Conversion.
Fundamental Programming Structures in Java: Comments, Data Types, Variables, Assignments, Operators.
Chapter 3: Introducing the Microsoft.NET Framework and Visual Basic.NET Visual Basic.NET Programming: From Problem Analysis to Program Design.
Lec2 P 1 CP2030 Visual Basic For C++ Programmers Copyright © University of Wolverhampton CP2030 VBFC Lecture 2 Back to Index v Basic Data Types v Arithmetic.
VB .NET Programming Fundamentals
Program A computer program (also software, or just a program) is a sequence of instructions written in a sequence to perform a specified task with a computer.
Copyright © 2001 by Wiley. All rights reserved. Chapter 3: Variables, Assignment Statements, and Arithmetic Variables Assignment Statements Arithmetic.
Variables & Math Operators CE 311 K - Introduction to Computer Methods Daene C. McKinney.
CPS120: Introduction to Computer Science Lecture 8.
CS0004: Introduction to Programming Variables – Numbers.
06/10/ Working with Data. 206/10/2015 Learning Objectives Explain the circumstances when the following might be useful: Disabling buttons and.
CS0004: Introduction to Programming Variables – Strings.
Chapter 3 Part 11 Variables, Constants, and Calculations Chapter 3 Section 3.3 Chapter 3 Section 3.4.
Program A computer program (also software, or just a program) is a sequence of instructions written in a sequence to perform a specified task with a computer.
Outline Software and Programming Program Structure Tools for Designing Software Programming Languages Introduction to Visual Basic (VBA)
Chapter 2: Using Data.
Arithmetic Operations. Review function statement input/output comment #include data type variable identifier constant declaration.
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 3 Variables, Constants, Methods, and Calculations.
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.
Chapter 3 P. 1 Data - Variables and Constants Definition A variable is a value which can change during program execution. A constant is a value which can.
CS 0004 –Lecture 3 Jan 10, 2011 Roxana Gheorghiu.
Variables & Function Calls. Overview u Variables  Programmer Defined & Intrinsic  Data Types  Calculation issues u Using Functions  The val() function.
CNS 1120 Exam 1 Review. Programming Language Elements Syntax = the rules to follow Syntax = the rules to follow Semantics = the meaning of symbols Semantics.
INT213-Week-2 Working with Variables. What is variable
Chapter 3 w Variables, constants, and calculations DIM statements - declaration temporary memory locations identifier, data type, scope data types - values.
Operators and Expressions. 2 String Concatenation  The plus operator (+) is also used for arithmetic addition  The function that the + operator performs.
Arithmetic, Class Variables and Class Methods Week 11
Lecture III Start programming in Fortran Yi Lin Jan 11, 2007.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 2A Reading, Processing and Displaying Data (Concepts)
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.
Programming with Microsoft Visual Basic th Edition
Variables Hold information that may be manipulated, used to manipulate other information or remembered for later use A storage location in memory (RAM)
Doing math In java.
CECS 5020 Computers in Education Visual Basic Variables and Constants.
110 E-1 Variables, Constants and Calculations(2) Chapter 3: Operations on variables, scope of a variable, formatting data Doing Arithmetic.
1 2/2/05CS250 Introduction to Computer Science II Pointers.
Data Handling in Algorithms. Activity 1 Starter Task: Quickly complete the sheet 5mins!
Creation of Variables with Numeric, alphanumeric, date, picture, memo data types Constant - A quantity that does not change during the execution of a program.
Chapter 3: Introducing the Microsoft.NET Framework and Visual Basic.NET Visual Basic.NET Programming: From Problem Analysis to Program Design.
1 st Semester Module2 Basic C# Concept อภิรักษ์ จันทร์สร้าง Aphirak Jansang Computer Engineering.
Week 1 Lecture 1 Slide 1 CP2028 Visual Basic Programming 2 “The VB Team” Copyright © University of Wolverhampton CP2028 Visual Basic Programming 2 v Week.
Introduction to Algorithmic Processes CMPSC 201C Fall 2000.
Making Interactive Programs with Visual Basic .NET
Slide 1 Chapter 3 Variables  A variable is a name for a value stored in memory.  Variables are used in programs so that values can be represented with.
© 2006 Lawrenceville Press Slide 1 Chapter 4 Variables  A variable is a name for a value stored in memory.  Variables are created using a declaration.
Slide 1 Chapter 3 Variables  A variable is a name for a value stored in memory.  Variables are created using a declaration statement. For example: Dim.
1Object-Oriented Program Development Using C++ Built-in Data Types Data type –Range of values –Set of operations on those values Literal: refers to acceptable.
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
A variable is a name for a value stored in memory.
Programming constructs
An Application Uses Variables to Hold Information So It May Be Manipulated, Used to Manipulate Other Information, or Remembered for Later Use.
BASIC ELEMENTS OF A COMPUTER PROGRAM
Visual Basic Variables
Data Types, Arithmetic Operations
ITEC113 Algorithms and Programming Techniques
Lecture Set 4 Data Types and Variables
Variables and Arithmetic Operations
Numbers.
Unit-1 Introduction to Java
VB Variables and Data
Engineering Problem Solving with C++ An Object Based Approach
Engineering Problem Solving with C++ An Object Based Approach
Variables and Constants
Presentation transcript:

Developing Software Applications Introduction to Variables & Data Types in VB State Transition Diagrams

Variables - Introduction A computer stores data in its memory. To store data, your program must tell the computer to set aside a block of memory. To do this you use variables. A variable is often compared to a box in which a value is stored. 10 iNum Value Name

Pat sName

Declaring variables Each variable has to be ‘declared’ before it is used E.g: Dim iCount As Integer This sets up a memory area 0 iCount

Naming conventions iTotalIntegere.g 387 fAverageFloating Pointe.g cSalaryCurrencye.g £4.28 sNameStringe.g Pat

Rules for variable names  must start with an alphabetic character  may only contain alphanumeric characters and the underscore _  may not exceed 240 characters  must not be a VB keyword

What code might need to use the data? Just in one event Just in one form In several forms

Dim, Private or Public ? Just in one event use Dim at start of that event this is called local data In more than one event but just in one form use Private after Option Explicit at top of code for that form this is called form level data

In more than one form Use Public Code in a Module This is called Global or Code level data Summarising : In 1 eventDim In 1 FormPrivate In several formsPublic

Examples Variables ~ Dim iCount as Integer Private dAverage as Double Public sName as String Constants ~ Const dVatRate = 17.5 n.b. no type declaration needed with constants

Data Types ~ summary

Arithmetic Operators Addition, subtraction+ - Multiplication, division * / Integer division \ Modulo arithmeticMod Exponentiation^ String concatenation &

Arithmetic Operators Order of precedence – Brackets Operands Division Multiplication Addition Subtraction

Projects with more than 1 form Etc ~

A State Transition Diagram ~ helps us to plan how the project will flow between different forms (or ‘states’) Add / Subtract form Mult / Square form Enter Name form Menu form Continue Start Exit Add or Subtract Return to Menu Mult or Square Return to Menu