Representing Data: Constants and Variables CHAPTER THREE Matakuliah: T0063 – Pemrograman Visual Tahun: 2009.

Slides:



Advertisements
Similar presentations
CS0004: Introduction to Programming Select Case Statements and Selection Input.
Advertisements

Working with Intrinsic Controls and ActiveX Controls
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
Chapter 3: Using Variables and Constants Programming with Microsoft Visual Basic 2005, Third Edition.
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
Chapter 11: Classes and Objects
1.
Data Types and Operations Programming Fundamentals (Writing Code)Programming Fundamentals (Writing Code)
1 Pertemuan 03 Representing Data Matakuliah: D0524 / Algoritma dan Pemrograman Komputer Tahun: 2005 Versi:
Chapter Three Using Variables and Constants Programming with Microsoft Visual Basic th Edition.
Slide 1 Chapter 2 Visual Basic Interface. Slide 2 Chapter 2 Windows GUI  A GUI is a graphical user interface.  The interface is what appears on the.
Visual Basic Chapter 1 Mr. Wangler.
Variables and Constants
Chapter 3: Using Variables and Constants
Programming with Microsoft Visual Basic th Edition CHAPTER THREE USING VARIABLES AND CONSTANTS.
The Data Element. 2 Data type: A description of the set of values and the basic set of operations that can be applied to values of the type. Strong typing:
Microsoft Visual Basic 2008: Reloaded Fourth Edition
Chapter 4: The Selection Structure
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
CHAPTER THREE Representing Data: Constants and Variables.
Working with Numeric Variables (Unit 6) Visual Basic for Applications.
Numeric Variables Visual Basic for Applications 6.
Chapter 12: How Long Can This Go On?
Microsoft Visual Basic 2005 CHAPTER 4 Variables and Arithmetic Operations.
Chapter 4 Variables and constants. 4.1 Variables -Use of variables is good programming style -easier to modify -easier for a programmer to understand.
Fundamentals of GUI Programming. Objectives: At the end of the session, you should be able to: describe the guidelines that are used for creating user-friendly.
Visual Basic Programming
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 3 Variables, Constants, Methods, and Calculations.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Three Memory Locations and Calculations.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter Three Using Variables and Constants.
Programming with Microsoft Visual Basic th Edition
Tutorial 3: Using Variables and Constants1 Tutorial 3 Using Variables and Constants.
Variables in VB.NET. Variables  A storage location in memory (RAM)  Holds data/information while the program is running  These storage locations can.
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.
Visual Basic CDA College Limassol Campus COM123 Visual Basic Programming Semester C Lecture:Pelekanou Olga Week 3: Using Variables.
Tutorial 3: Using Variables and Constants1 Tutorial 3 Using Variables and Constants.
CHAPTER THREE Representing Data: Constants and Variables.
Variables and Expressions Programming Right from the Start with Visual Basic.NET 1/e 7.
Microsoft Visual Basic 2012 CHAPTER FOUR Variables and Arithmetic Operations.
Chapter 4: Variables, Constants, and Arithmetic Operators Introduction to Programming with C++ Fourth Edition.
Chapter 4 Chapter 4: Variables, Constants, and Arithmetic Operators.
Making Interactive Programs with Visual Basic .NET
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.
Programming with Microsoft Visual Basic 2012 Chapter 3: Using Variables and Constants.
© 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.
Visual Basic/ Visual Studio Brandon Large. Connecting to prior knowledge In your notes write down what the two main parts of the computer are. The “software”
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
Representing Data: Constants and Variables
Microsoft Visual Basic 2010 CHAPTER FOUR Variables and Arithmetic Operations.
Visual Basic.NET Windows Programming
Egyptian Language School Computer Department
Introduction to Programming Lecture 2
A variable is a name for a value stored in memory.
Arithmetic operations and operators, converting data types and formatting programs for output. Year 11 Information Technology.
© 2016, Mike Murach & Associates, Inc.
Variables and Arithmetic Operations
Chapter 3: Using Variables and Constants
Variables and Arithmetic Operations
Lecture 5 from (Chapter 4, pages 73 to 96)
Microsoft Visual Basic 2005 BASICS
Numbers.
Objectives After studying this chapter, you should be able to:
CIS16 Application Development Programming with Visual Basic
CHAPTER FOUR VARIABLES AND CONSTANTS
Data Types and Expressions
The Data Element.
The Data Element.
Variables and Constants
Presentation transcript:

Representing Data: Constants and Variables CHAPTER THREE Matakuliah: T0063 – Pemrograman Visual Tahun: 2009

Bina Nusantara University 2 Chapter Introduction Compose event procedures that perform more sophisticated tasks. Focus specifically on data items. Continue work with Visual Basic.NET project structure. Determine the meaning of the term scope.

Bina Nusantara University 3 Objectives Differentiate between numeric and string data. Determine whether a data item should be a constant or variable. Code constants and variables in event procedures. Describe the characteristics and uses of standard data types. Create projects that consist of several forms. Explain scope and describe the domain of variables in procedures and forms.

Bina Nusantara University Data Categorization Two broad categories of data are numeric and string. –Numeric data must contain only numbers. –String data can contain any symbol. –Numeric data is used in arithmetic calculations. –String data cannot be used in calculations.

Bina Nusantara University Constants Data item whose value is assigned at design time and remains the same at run time. A literal constant is just a value. A symbolic constant is a descriptive name substituted for a literal constant.

Bina Nusantara University 6 Standard Data Types Number of Bytes –Main memory occupied by a variable. Range –Largest and smallest values that can be stored in a numeric variable of a given type.

Bina Nusantara University 7 Standard Data Types (cont.) Precision –Indicates how close together two numeric values can be. Speed of Arithmetic Calculation –Differs for the different data types.

Bina Nusantara University 8 Choosing the Best Data Type for a Variable Use decision rules –Ex. Boolean is the best type for a variable that may be true or false. –Ex. Decimal is the best type for a dollar amount.

Bina Nusantara University 9 Declaring Variables: The Dim Statement A variable declaration statement. –Examples: Dim StreetAddress As String Dim GrossWeight As Integer Dim HomePhone As String Dim NetIncome As Decimal Dim CurrentStudent As Boolean

Bina Nusantara University 10 Using Variables: The Assignment Statement Syntax of the Assignment Statement –variablename = expression Ex. CourseCode = “CISB119” Run Time: The Effect of the Assignment Statement –Evaluates expression on right side of equal sign. –Stores value of expression in variable on left side of equal sign.

Bina Nusantara University 11 Appearance and Use Multiple forms may be used for large projects. –Each form should represent an objective. –Each form should be clear and attractive. Each form is a user interface window during run time. All forms have the same basic components.

Bina Nusantara University 12 Properties of the Form Control (Name) AcceptButton BackColor CancelButton ControlBox Font MaximizeBox MinimizeBox Text

Bina Nusantara University 13 Form as a Class You create a class template by creating a form. Buttons and text boxes are added to the class definition. Events are methods added to the form class. Many properties and methods are inherited from the form’s superclass.