Objects Allow us to represent and control the computer technology Use methods to make the object do something Use properties to find out and change the.

Slides:



Advertisements
Similar presentations
Driving Test 1 Marking Scheme Focus on five areas to pass driving test 1.
Advertisements

Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
 Variables  What are they?  Declaring and initializing variables  Common uses for variables  Variables you get “for free” in Processing ▪ Aka: Built-in.
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.
VARIABLES: Your Own Piece of the ram. Why Use Variables? To save a piece of data in memory To save a piece of data in memory To store results of a calculation.
Week 2: Primitive Data Types 1.  Programming in Java  Everything goes inside a class  The main() method is the starting point for executing instructions.
Variables in VB Keeping Track. Variables Variables are named places in the computer memory that hold information. Variables hold only a single value at.
If You Missed Last Week Go to Click on Syllabus, review lecture 01 notes, course schedule Contact your TA ( on website) Schedule.
1 Pertemuan 03 Representing Data Matakuliah: D0524 / Algoritma dan Pemrograman Komputer Tahun: 2005 Versi:
110-D1 Variables, Constants and Calculations(1) Chapter 3: we are familiar with VB IDE (building a form…) to make our applications more powerful, we need.
VARIABLES, TYPES, INPUT/OUTPUT, ASSIGNMENT OPERATION Shieu-Hong Lin MATH/CS Department Chapel.
PHP : Hypertext Preprocessor
CS0004: Introduction to Programming Variables – Numbers.
Data Representation S2. This unit covers how the computer represents- Numbers Text Graphics Control.
Week 2 - Monday.  What did we talk about last time?  Software development  Lab 1.
Rote Learning of the Week "A variable is a named section of RAM that stores data of a specific data type"
A Level Computing#BristolMet Session ObjectivesU2#S10 MUST describe the difference between constants, local and global variables SHOULD explain why constants.
06/10/ Working with Data. 206/10/2015 Learning Objectives Explain the circumstances when the following might be useful: Disabling buttons and.
Variables "There are 10 kinds of people in the world today – those who understand binary and those who don't!” Unknown.
Mastering Char to ASCII AND DOING MORE RELATED STRING MANIPULATION Why VB.Net ?  The Language resembles Pseudocode - good for teaching and learning fundamentals.
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’
Introduction to Java Applications Part II. In this chapter you will learn:  Different data types( Primitive data types).  How to declare variables?
Copyright 1999 by Larry Fuhrer. Pascal Programming Getting Started...
Chapter 4 Variables and constants. 4.1 Variables -Use of variables is good programming style -easier to modify -easier for a programmer to understand.
5 BASIC CONCEPTS OF ANY PROGRAMMING LANGUAGE Let’s get started …
Primitive Variables.
University of Sunderland CIF 102/FIF102 Fundamentals of DatabasesUnit 15 Programming in Microsoft Access using VBA Using VBA to add functionality.
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
CS0004: Introduction to Programming Project 1 – Lessons Learned.
Data Types and Variables. Data Type! Computers are all about Data! Data can be in the form of Text Dates Sounds Pictures.
I Power Higher Computing Software Development Development Languages and Environments.
Validation "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs and the Universe trying to.
Variables & Function Calls. Overview u Variables  Programmer Defined & Intrinsic  Data Types  Calculation issues u Using Functions  The val() function.
Chapter 4 Variables and constants. 4.1 Variables -Use of variables is good programming style -easier to modify -easier for a programmer to understand.
String and General Procedures. Answer to the last question of Exam 1 Start Get a number Divide the Number By 2 Is the quotient Equal to 1? Print The Remain.
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
Data,information Data and Information 4 Data –Raw, unorganised facts –Ideas or concepts 4 Information –When data is manipulated into a meaningful form.
Data Tonga Institute of Higher Education. Variables Programs need to remember values.  Example: A program that keeps track of sales needs to remember.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 2A Reading, Processing and Displaying Data (Concepts)
# 1# 1 What is a variable that you create? What is a constant that you create? What is an intrinsic (built-in) constant? What variables are built in?
Variables 1. What is a variable? Something whose value can change over time This value can change more than once over the time period (no limit!) Example:
Program Organization Sequential Execution: One line done after the other Conditional Execution: If a test is true, one section is done, otherwise another.
Chapter 4 Getting Started with VBA. Subroutines Subroutine is the logical section of code that performs a particular task. Subroutine is also called a.
CPS120: Introduction to Computer Science Variables and Constants.
Introduction to Java Applications Part II. In this chapter you will learn:  Different data types( Primitive data types).  How to declare variables?
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.
Values, Types, and Variables. Values Data Information Numbers Text Pretty much anything.
Controlling Program Flow with Decision Structures.
CS 106 Introduction to Computer Science I 09 / 10 / 2007 Instructor: Michael Eckmann.
Data and variables in Visual Basic. Annoucement Lecture on Thursday 7:30PM C106 Visual Basic download: 
Chapter 4.  Variables – named memory location that stores a value.  Variables allows the use of meaningful names which makes the code easier to read.
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.
Introduction to Python Lesson 2a Print and Types.
Last week: We talked about: History of C Compiler for C programming
Week 2 - Wednesday CS 121.
A variable is a name for a value stored in memory.
Documentation Need to have documentation in all programs
Data Types, Arithmetic Operations
Variables Data Types and Assignment
Microsoft Visual Basic 2005 BASICS
Introduction to C++ Programming
Variables ICS2O.
Presenting information as bit patterns
ICT Programming Lesson 4:
Variables In today’s lesson we will look at: what a variable is
Chapter 2: Introduction to C++.
Variables Data Types and Assignment
Primitive Types and Expressions
B065: PROGRAMMING Variables 2.
Variables Data Types and Assignment
Presentation transcript:

Objects Allow us to represent and control the computer technology Use methods to make the object do something Use properties to find out and change the settings of the object

Screen Objects

The Assignment Operator The symbol for copying and allocating data around the system Very important concept in programming

How it works txtMessage.Text = “Hello world” ‘The message hello world is assigned to the text box named message The assignment operator copies data from right to left Left Right Destination = Source

Variables and RAM Computer RAM is VERY COMPLICATED It stores data as binary values “hello” stored as … “ ” Variables spare us a great deal of pain!

Variables cont’d Variables are a very simple kind of object They allow us to control a section of RAM Four things we want to do… Allocate a section of RAM Give that section a name Set the rules for the type of data it will store Store some data in the variable

Think as Variables a Boxes in RAM or of all the information we want to store The seven variables declared above have the following names… ErrMsg OfferTitle Description SwapNo Userno UserName A series of boxes are created…

Data Types Notice also in declaring variables we give them a data type, e.g. As String Sets the rule as to the type of data we may put in the box

Creating Variables Variables are “declared” using the key word “Dim”

Declare Variables at the top of your code… Makes them easier to find Must declare a variable before we may use it

Global and Local Variables Local : For use for a particular object only i.e. btnCalculate Set variable inside the Private sub Global: For use for the whole programme i.e. Mini Calculator Set variable at the start of programme underneath Public class

Rules for Variable Names We do not have any spaces in the variable names Err MsgBad ErrMsgGood Use underscore if you want a space e.g. Err_Msg The variable names use pascal case swapnoBad SwapNo Good The names must be meaningful A, B & C are normally bad names as they give no clue as to their usage

Data Types Integer whole number in the range from - 2,147,483,648 to 2,147,483,647 Byte whole number between 0 and 255 String any combination of numbers and letters Dateany valid date or time Booleantrue or false Decimalany whole or decimal number big range so good for mathematical calculations

Processing data (Input) Dim FirstName as String FirstName = txtFirstName.Text This would enable us to input a first name (letters/text) in to a text box named FirstName. It would not allow numbers or any other data type.

A Simple Application To finish off we will create the following application…

With the following code…

Common Variable Errors Learn to recognise the errors Missing variable declaration Mismatched Variable Names Selection of incorrect data type