Rote Learning of the Week "A variable is a named section of RAM that stores data of a specific data type"

Slides:



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

CS0007: Introduction to Computer Programming Console Output, Variables, Literals, and Introduction to Type.
Data Types and Expressions
Mark Dixon, SoCCE SOFT 131Page 1 04 – Information Processing: Data-types, Variables, Operators & Functions.
If You Missed Last Week Go to Click on Syllabus, review lecture 01 notes, course schedule Contact your TA ( on website) Schedule.
Introduction to Python
Introduction to a Programming Environment
Chapter 2: Introduction to C++.
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.
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, Constants, Methods, and Calculations Chapter 3 - Review.
VARIABLES, TYPES, INPUT/OUTPUT, ASSIGNMENT OPERATION Shieu-Hong Lin MATH/CS Department Chapel.
CS0004: Introduction to Programming Variables – Numbers.
Variables "There are 10 kinds of people in the world today – those who understand binary and those who don't!” Unknown.
Introduction to Java Applications Part II. In this chapter you will learn:  Different data types( Primitive data types).  How to declare variables?
3 - Variables Lingma Acheson Department of Computer and Information Science, IUPUI CSCI N331 VB.NET Programming.
Chapter 4 Variables and constants. 4.1 Variables -Use of variables is good programming style -easier to modify -easier for a programmer to understand.
University of Sunderland CIF 102/FIF102 Fundamentals of DatabasesUnit 15 Programming in Microsoft Access using VBA Using VBA to add functionality.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 3 Variables, Constants, Methods, and Calculations.
ICAPRG301A Week 2 Strings and things Charles Babbage Developed the design for the first computer which he called a difference engine, though.
Copyright © 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved. Chapter 2: Introduction to C++
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.
Sanjay Johal. Introduction(1.1) In this PowerPoint I will be explaining :  The purpose of the code for each of the two given programs, e.g. to carry.
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.
Data Tonga Institute of Higher Education. Variables Programs need to remember values.  Example: A program that keeps track of sales needs to remember.
Variables and Expressions CMSC 201. Today we start Python! Two ways to use python: You can write a program, as a series of instructions in a file, and.
# 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?
Programming with Microsoft Visual Basic th Edition
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.
Variables Hold information that may be manipulated, used to manipulate other information or remembered for later use A storage location in memory (RAM)
1 Writing Software Kashef Mughal. 2 Algorithms  The term algorithm (pronounced AL-go-rith-um) is a procedure or formula for solving a problem.  An Algorithm.
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.
Visual Basic CDA College Limassol Campus COM123 Visual Basic Programming Semester C Lecture:Pelekanou Olga Week 3: Using Variables.
Values, Types, and Variables. Values Data Information Numbers Text Pretty much anything.
Controlling Program Flow with Decision Structures.
DATA TYPES, VARIABLES AND CONSTANTS. LEARNING OBJECTIVES  Be able to identify and explain the difference between data and information  Be able to identify,
Data Handling in Algorithms. Activity 1 Starter Task: Quickly complete the sheet 5mins!
Visual Basic.NET Programming for the Rest of Us Keith Mulbery Utah Valley State College.
Data and variables in Visual Basic. Annoucement Lecture on Thursday 7:30PM C106 Visual Basic download: 
B065: PROGRAMMING Variables 2. Starter  What is wrong with the following piece of code: Option Explicit Off Dim num1 as string Dim num2 as integer num1.
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.
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.
IMAT1604 Visual Web Development. About me… Matthew Dean (Or Google mjdean dmu)
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.
Unit 2 Technology Systems
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
ITEC113 Algorithms and Programming Techniques
Variables and Primative Types
Variables Data Types and Assignment
Microsoft Visual Basic 2005 BASICS
2.1 Parts of a C++ Program.
Variables Numbers can be stored and retrieved while a program is running if they are given a home. The way that integers and decimal numbers are stored.
Visual Basic Programming Chapter Four Notes Working with Variables, Constants, Data Types, and Expressions GROUPBOX CONTROL The _____________________________________.
List Based Objects.
CS285 Introduction - Visual Basic
What is an Object Anyway?
ICT Programming Lesson 4:
Chapter 2: Introduction to C++.
List Based Objects.
Variables Data Types and Assignment
List Based Objects.
Primitive Types and Expressions
Variables Data Types and Assignment
Presentation transcript:

Rote Learning of the Week "A variable is a named section of RAM that stores data of a specific data type"

Objects In the first lecture we introduced the idea of classes and objects One way of looking at an object is that it is a word in our code that links to the functions in a class Once we have an instance of an object (the word) we may access the methods and properties defined in the class Properties allow us to change or find out about some aspect of the data Methods allow us to perform some action on the data There are lots of different objects within the computer system all allowing us to control data in different ways

Screen Objects Event driven

System Architecture Presentation (Interface) Data Layer Database Middle Tier Business Logic (Objects/Classes)

Layers Split in to Other Layers Interface and code linked by events

Click Event Handler Event Handler = Function that responds to an event

Interface v RAM Exercise Split into two teams Both teams to count from 1 – 50 One team to write the numbers on paper The other team to count in their heads Everybody stand Raise your hand when you have finished

The Assignment Operator The symbol for copying data around the system Possibly the most important concept in programming Fail to grasp how this works and you won’t progress

How it works txtMessage.Text = “Hello world”; The assignment operator copies data from right to left Destination = Source All together now!

Computer Technology We need objects & classes to control all this!

Where the RAM fits in The RAM

Variables and RAM Computer RAM is VERY COMPLICATED Stores data as binary values “hello” stored as … “ ” Variables spare us a great deal of pain! Variables are a very simple kind of object Allow us to control a section of RAM Three things we want to do… Allocate a section of RAM Give that section a name (a word) Set the rules for the type of data it will store Store some data in the variable

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

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

Data Types Integer whole number Types of Int Int to Int32 (or just Int)-2,147, to +2,147, Int to String any combination of numbers and letters DateTimeany valid date or time Booleantrue or false Decimalany whole or decimal number

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

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

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 or camel case swapnoBad SwapNo Good (public variable) swapNoGood (private variable) The names must be meaningful A, B & C are normally bad names as they give no clue as to their usage

Things we do with Variables Assign literal constants

Perform Calculations

Get data off the Interface string FirstName; FirstName = txtFirstName.Text;

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

Common Variable Errors We shall look at some common errors in Visual Studio Learn to recognise the errors Missing variable declaration Mismatched Variable Names Selection of incorrect data type Rounding errors Overflow errors