Visual Basic 2010 How to Program © 1992-2011 by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais1.

Slides:



Advertisements
Similar presentations
Pemrograman VisualMinggu …2… Page 1 MINGGU Ke Dua Pemrograman Visual Pokok Bahasan: Console Application Tujuan Instruksional Khusus: Mahasiswa dapat menjelaskan.
Advertisements

Chapter 2 Part B CISS 241. Take a few moments and work with another student to develop an algorithm for a program that will add two whole numbers (integers)
Lecture 2 Introduction to C Programming
Introduction to C Programming
 2005 Pearson Education, Inc. All rights reserved Introduction.
1 Chapter 2 Introduction to Java Applications Introduction Java application programming Display ____________________ Obtain information from the.
Chapter 2 Introduction to C Programming
Introduction to C Programming
1 Outline 13.1Introduction 13.2A Simple Program: Printing a Line of Text in a Web Page 13.3Another JavaScript Program: Adding Integers 13.4Memory Concepts.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
 2002 Prentice Hall. All rights reserved. 1 Outline 3.1Introduction 3.2Simple Program: Printing a Line of Text 3.3Another Simple Program: Adding Integers.
 2007 Pearson Education, Inc. All rights reserved Introduction to C Programming.
Introduction to C Programming
Introduction to C++ Programming
CSCI 1730 January 17 th, 2012 © by Pearson Education, Inc. All Rights Reserved.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 6 Enhancing the Inventory Application Introducing Variables, Memory Concepts and.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 2 - Welcome Application: Introduction to C++
Java™ How to Program, 9/e © Copyright by Pearson Education, Inc. All Rights Reserved.
Android How to Program, 2/e © Copyright by Pearson Education, Inc. All Rights Reserved.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.
Introduction to Java Applications Part II. In this chapter you will learn:  Different data types( Primitive data types).  How to declare variables?
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 2 Input,
 Simple C# program  Console applications input and output text in a console window, which in Windows XP and Windows Vista is known as the Command Prompt.
C How to Program, 7/e © by Pearson Education, Inc. All Rights Reserved.
Chapter 2: Using Data.
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 2 Chapter 2 - Introduction to C Programming.
Week 1 Algorithmization and Programming Languages.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 5 Completing the Inventory Application Introducing Programming.
C++ How to Program, 8/e © by Pearson Education, Inc. All Rights Reserved.
 Pearson Education, Inc. All rights reserved Introduction to Java Applications.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Security Panel Application Introducing the Select Case Multiple-Selection Statement.
C++ How to Program, Late Objects Version, 7/e © by Pearson Education, Inc. All Rights Reserved.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 3 Variables, Constants, Methods, and Calculations.
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais1.
Introduction to Visual Basic Programming. Introduction Simple Program: Printing a Line of Text Another Simple Program: Adding Integers Memory Concepts.
Chapter 3 Syntax, Errors, and Debugging Fundamentals of Java.
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.1.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
 2000 Deitel & Associates, Inc. All rights reserved. Outline 8.1Introduction 8.2A Simple Program: Printing a Line of Text in a Web Page 8.3Another JavaScript.
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 5.1 Test-Driving the Inventory Application.
Chapter 4 Variables and constants. 4.1 Variables -Use of variables is good programming style -easier to modify -easier for a programmer to understand.
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.1.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 3 – Inventory Application: Introducing Variables,
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Part:2.  Keywords are words with special meaning in JavaScript  Keyword var ◦ Used to declare the names of variables ◦ A variable is a location in the.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 2 - Introduction to C Programming Outline.
CHAPTER 2 PROBLEM SOLVING USING C++ 1 C++ Programming PEG200/Saidatul Rahah.
Introduction to Java Applications Part II. In this chapter you will learn:  Different data types( Primitive data types).  How to declare variables?
 Most C programs perform calculations using the C arithmetic operators (Fig. 2.9).  Note the use of various special symbols not used in algebra.  The.
REEM ALMOTIRI Information Technology Department Majmaah University.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
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.
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.
Chapter 2 of C++ How to Program, 10/e © by Pearson Education, Inc. All Rights Reserved.
A variable is a name for a value stored in memory.
Chapter 6 JavaScript: Introduction to Scripting
ARITHMETIC IN C Operators.
Chapter 2 Introduction to C++ Programming
Chapter 2: Introduction to Visual Basic Programming
Variables and Arithmetic Operations
Introduction to C++ Programming
WEB PROGRAMMING JavaScript.
Chapter 2, Part III Arithmetic Operators and Decision Making
Presentation transcript:

Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais1

2

 Visual Basic programmers use a combination of visual programming and conventional programming techniques.  In Fig. 3.2, displays a code that modify a Label ’s text programmatically.  The text displayed on the Form to change when you execute the program.  This code performs an action (change the label’s text) when the Form loads that is, when the program executes and displays the Form. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais3

4

 Line Numbers ◦ All of our program listings include line numbers—these are not part of Visual Basic. ◦ The line numbers help us refer to specific parts of a program. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais5

 Comments ◦ Line 1 of Fig. 3.2 begins with a single-quote character ('), which indicates that the remainder of the line is a comment. ◦ Comments improve the code’s readability—you can write anything you want in a comment. ◦ Comments can be placed either:  On their own lines ( “full-line comments”; as in lines 1–2)  Or at the end of a line of Visual Basic code (“end-of-line comments”; as in lines 9 and 10). ◦ The compiler ignores comments—they do not cause the computer to perform any actions when a program runs. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais6

 Classes ◦ Windows Forms applications consist of pieces called classes. ◦ Classes are logical groupings of methods and data that simplify program organization. ◦ Methods perform tasks and can return information when the tasks are completed. ◦ Lines 3–10 define a class that represents our Form. ◦ These lines collectively are called a class declaration. ◦ Every Windows Form s application consists of at least one class that typically contains methods that perform tasks. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais7

 Keywords ◦ The words Public and Class (line 3) are examples of keywords. ◦ Keywords are words reserved for use by Visual Basic. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais8

 Class Names and Identifiers ◦ The name of the Class — ASimpleProgram in line 3—is an identifier, which is a series of characters consisting of letters, digits and underscores ( _ ). ◦ Identifiers cannot begin with a digit and cannot contain spaces. ◦ Examples of valid identifiers are value1, Welcome1-, xy_coordinate, _total and grossPay. ◦ The name 7Welcome is invalid because it begins with a digit; input field is ivalid because it contains a space. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais9

10

 Visual Basic Is Not Case Sensitive ◦ Visual Basic keywords and identifiers are not case sensitive. ◦ Uppercase and lowercase letters are considered to be identical, so asimpleprogram and ASimpleProgram are interpreted as the same identifier. ◦ If you write any keyword in lower case format the IDE will automatically correct it to upper case letter, for example: If you write the word “class” IDE convert it to “Class” directly © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais11

 Blank Lines and Whitespace ◦ Line 7 (Fig. 3.2) is a blank line. ◦ Blank lines, space characters and tab characters are used throughout a program to make it easier to read. ◦ These are called whitespace. ◦ Blank lines are ignored by the compiler. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais12

 The Form’s Load Event and Method ASimpleProgram_Load ◦ GUIs are event driven. ◦ When the user interacts with a GUI component, the interaction—known as an event—causes the program to perform a task by “calling” a method. ◦ Common events (user interactions) include clicking a Button, selecting an item from a menu, closing a window and moving the mouse. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais13

 All GUI controls, including Form s, have events associated with them.  A method that performs a task in response to an event is called an event handler,  The process of responding to events is known as event handling.  Most of a GUI application’s functionality executes based on events.  Event handling methods are called automatically. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais14

 A common event for a Form is its Load event, which occurs just before a Form is displayed on the screen— typically as a result of executing the program.  Lines 5–9 define the method ASimple-Program_Load as the Form ’s Load event handler.  When this event is raised (that is, the event occurs), method ASimple-Program_Load executes to perform its task—changing the text in the Label. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais15

 At the end of line 6, the clause  Handles MyBase.Load indicates that method ASimple-Program_Load is the one that will be called to handle the Form ’s Load event.  The IDE automatically inserts this clause for you when you create the event handler. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais16

 Defining a Method ◦ The keyword Sub (line 5) begins the method declaration ◦ The keywords End Sub (line 9) close the method declaration. ◦ The body of the method declaration appears between the keywords Sub and End Sub. ◦ The keyword Sub is short for “subroutine” ◦ Methods are also sometimes called procedures. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais17

 When this line executes, it changes the Label ’s Text  property to the message Visual Basic is fun!.  This updates the text on the Form (Fig. 3.2).  The statement uses the assignment operator (=) to give the Text property a new value.  The statement is read as, “ Label1.Text gets the value "Visual Basic is fun!".” © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais18

 The expression Label1.Text contains two identifiers separated by the dot separator (.).  The identifier to the right of the dot is the property name, and the identifier to the left of the dot is the name of the Label control.  When you add a Label to a Form, the IDE gives it the name Label1 by default for the first Label you add. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais19

 Note About Public and Private ◦ Most classes you’ll define begin with keyword Public ◦ Most event-handling methods begin with the keyword Private. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais20

 Naming the Form Class ◦ In larger programs, you might have several Form s inside the solution with different purposes. ◦ To change the file name from Form1.vb to ASimpleProgram.vb do the following:  Right click the file in the Solution Explorer  Select Rename  Type the new file name. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais21

 Writing Code and Using IntelliSense ◦ As you begin typing, a small window appears (Fig. 3.6). ◦ This IDE feature, called Intelli-Sense,  lists keywords, class names, members of a class (which include property and method names) ◦ Tabs ( Common and All ) in Intelli-Sense  Common : view the most commonly used matches.  All: view all the available matches. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais22

© by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais23

 Notice that once you type the dot (. ) after Label1, the IntelliSense window shows only the members of class Label that can be used on the right side of the dot. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais24

 Compiling and Running the Program ◦ To execute your program :  Select Debug > Start Debugging  Or press F5  Or the toolbar button. ◦ When you run a program, the IDE first compiles it. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais25

 You can also compile the program without running it by: ◦ selecting Debug > Build ASimpleProgram  This creates a new file with the project’s name and the.exe file-name extension ( ASimpleProgram.exe ).  This file contains a program’s code, which executes on the.NET Framework.  The.exe file extension indicates that the file is executable. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais26

 Syntax Errors, Error Messages and the Error List Window ◦ When you type a line in an incorrect way a syntax error occur. ◦ Syntax error means one or more statements violate Visual Basic’s syntax rules, It happens before execution time. ◦ Syntax errors occur for various reasons, such as missing parentheses and misspelled keywords. ◦ When a syntax error occurs, the IDE places a blue squiggle below the error and provides a description of the error in the Error List window. ◦ runtime error is an error that has its effect at execution time. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais27

 If the Error List window is not visible in the IDE, select View > Other Windows > Error List to display it.  In Fig. 3.7, we omitted the parenthesis at the end of line 6.  The error contains the text “ ')' expected. ” and specifies that the error is in column 33 of line 6.  This informs you that a right parenthesis is missing in line 6.  You can double click an error message in the Error List to jump to the line of code that caused the error.  For some errors (such as this one), the IDE shows the Error Correction Options drop-down list and allows you to simply click a link to fix the error. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais28

© by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais29

© by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais30

 Variable Declarations and Naming ◦ Lines 8–10 are declarations, which begin with keyword Dim. ◦ The words number1, number2 and total are identifiers for variables ◦ Variables are locations in the computer’s memory where values can be stored for use by a program. ◦ All variables must be declared before they can be used. ◦ The variables number1, number2 and total are data of type Integer ◦ Integer (that is, whole numbers such as 919, –11, 0 and ). ◦ Data types defined as part of the Visual Basic language, such as Integer, are known as primitive types and their type names are keywords (Fig 3.9). © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais31

© by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais32

 A variable name can be any valid identifier.  Variables of the same type can be declared in separate statements or they can be declared in one statement separated by a comma.  You should choose meaningful variable names to make your programs “self-documenting” & more readable. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais33

 Tips in naming variables - The “camel case”. ◦ It is a way for naming variables so that The first word in a variable-name begins with a lowercase letter and every word after the first one should with an uppercase letter.  Example: firstNumber. ◦ Helps make your programs more readable. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais34

 Using Variables to Store the Values Entered by the User ◦ Line 12: number1 = number1TextBox.Text ◦ We call this statement an assignment statement because it assigns a value to a variable. ◦ The expression number1TextBox.Text gets the value that the user typed in the TextBox. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais35

 What if the User Doesn’t Enter an Integer? ◦ For this program, if the user types a noninteger value, such as " hello," a runtime error occurs. ◦ A detailed description of the error is displayed in the Error List window. ◦ The message displayed in Fig appears when you run the application using Debug > Start Debugging (or press F5). ◦ In this case, you can terminate the program by selecting Debug > Stop Debugging or typing Ctrl + Alt + Break. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais36

© by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais37

 Suppose the user enters the characters 45.  This input is returned by number1TextBox.Text and assigned to number1.  The program places the Integer value 45 into location number1, as shown in Fig  Whenever a value is placed in a memory location, this value replaces the value previously stored in that location.  The previous value is lost. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais38

© by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais39

 Suppose that the user then enters the characters 72 in number2TextBox.  Line 13 ' get the second number entered number2 = number2TextBox.Text places the Integer value 72 into location number2, and memory appears, as shown in Fig © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais40

© by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais41

 Once the program has obtained values for number1 and number2, it adds these values and places their total into variable total.  The statement (line 14) ' add the two numbers total = number1 + number2  After total is calculated, memory appears, as in Fig  The values of number1 and number2 appear exactly as they did before they were used in the calculation of total.  Although these values were used when the computer performed the calculation, they remain unchanged.  As this illustrates, when a value is read from a memory location, the value is retained in memory. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais42

© by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais43

 Programs often perform arithmetic calculations.  The arithmetic operators are summarized in Fig  the asterisk (*) indicates multiplication, and the keyword Mod represents the Mod operator (also known as the modulus or modulo operator) © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais44

 Most of the arithmetic operators in Fig are binary operators, because each operates on two operands.  Visual Basic also provides unary operators that take only one operand.  For example, unary versions of plus ( + ) and minus ( – ) are provided, so that you can write expressions such as +9 and –19. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais45

© by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais46

 Division Operators ◦ Visual Basic has separate operators for:  integer division (the backslash, \ )  floating-point division (the forward slash, / ). ◦ Integer division takes two Integer operands and yields an Integer result;  for example, 7 \ 4 = 1 11 \ 2 = 5 ◦ Any fractional part in an Integer division result simply is discarded. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais47

 When floating-point numbers are used with the integer division operator, the numbers are first rounded to the nearest whole number, then divided.  This means that, ◦ 7/4 evaluates to 1 ◦ 7.1 / 4 evaluates to 1 ◦ 7.7 / 4 evaluates to 2, because 7.7 is rounded to 8 before the division occurs. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais48

© by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais49

 Mod Operator ◦ The Mod operator yields the remainder after division. ◦ The expression x Mod y yields the remainder after x is divided by y. ◦ Thus, 7 Mod 4 yields 3, and 17 Mod 5 yields 2. ◦ You use this operator mostly with Integer operands, but it also can be used with other types. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais50

 Arithmetic Expressions in Straight- Line Form ◦ Arithmetic expressions must be entered into the computer in straight-line form. ◦ Thus, expressions such as “ a divided by b ” must be written as a / b, so that all constants, variables and operators appear in a straight line. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais51

 Parentheses for Grouping Subexpressions ◦ Parentheses are used in Visual Basic expressions in the same manner as in algebraic expressions. ◦ For example, to multiply a times the quantity b + c, we write a * (b + c). © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais52

 Operators in arithmetic expressions are applied in a precise sequence determined by the rules of operator precedence (Fig. 3.24), which are similar to those in algebra.  Operators in the same row of the table are said to have the same level of precedence.  When we say operators are evaluated from left to right, we’re referring to the operators’ associativity. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais53

© by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais54

 Rules of Operator Precedence ◦ Operators in arithmetic expressions are applied in a precise sequence determined by the rules of operator precedence (Fig. 3.24), which are similar to those in algebra. ◦ Operators in the same row of the table are said to have the same level of precedence. ◦ When we say operators are evaluated from left to right, we’re referring to the operators’ associativity. ◦ All binary operators associate from left to right. ◦ If there are multiple operators, each with the same precedence, the order in which the operators are applied is determined by the operators’ associativity. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais 55

 Operators in expressions contained within a pair of parentheses “()” are evaluated before those that are outside the parentheses.  Parentheses can be used to group expressions and change the order of evaluation to occur in any sequence you desire.  With nested parentheses, the operators contained in the innermost pair of parentheses are applied first.  For example, although the expression  a * (b + c) + c * (d + e)  contains multiple sets of parentheses, none are nested.  Rather, these sets are said to be “on the same level.” © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais56

© by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais57

 Redundant Parentheses ◦ As in algebra, it is acceptable to place unnecessary parentheses in an expression to make the expression clearer—these are called redundant parentheses. ◦ For example, many people might parenthesize the preceding assignment statement for clarity as y = (a * x ^ 2) + (b * x) + c © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais58

© by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais59

 Operator Precedence ◦ Figure 3.30 shows the precedence of the operators. ◦ The operators are displayed from top to bottom in decreasing order (from highest to the lowest priority) of precedence. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais60

© by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais61

 Using Variables in a Calculation ◦ The assignment statement : Total = number1+number2 ◦ The expression to the right of the = is always evaluated first before the assignment occurs. ◦ The addition ( + ) operator is called a binary operator, because it has two operands— number1 and number2. © by Pearson Education, Inc. All Rights Reserved. - edited by Maysoon Al-Duwais62