VB Math All of your favorite mathematical operators are available in VB: + Addition - Subtraction * Multiplication / Division \ Integer Division Mod Modulo.

Slides:



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

Operators, Expressions and Assignment Calculating Things...
Datalogi A 3: 26/9. Java Concepts chapter 4 Fundamental Data Types int (long and short) double (and float) boolean char String.
Developing Software Applications Introduction to Variables & Data Types in VB State Transition Diagrams.
Chapter 3: Introducing the Microsoft.NET Framework and Visual Basic.NET Visual Basic.NET Programming: From Problem Analysis to Program Design.
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 & Math Operators CE 311 K - Introduction to Computer Methods Daene C. McKinney.
Week 2 - Friday.  What did we talk about last time?  Data representation  Binary numbers  Types  int  boolean  double  char  String.
Guide to Programming with Python Chapter Two Basic data types, Variables, and Simple I/O: The Useless Trivia Program.
Chapter 5 new The Do…Loop Statement
Chapter 31 Fundamentals of Programming in Visual Basic (Continue VI) String Properties and Methods: "Visual".Length is 6. "Visual".ToUpper is VISUAL. "123.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Ten String Manipulation and Menus.
Chapter 8: String Manipulation
CS0004: Introduction to Programming Variables – Numbers.
CS0004: Introduction to Programming Input and Output.
COMPUTER PROGRAMMING I Objective 7.04 Apply Built-in String Functions (3%)
COM148X1 Interactive Programming Lecture 3. Topics Today String Functions Using Timer Looping.
CS0004: Introduction to Programming Variables – Strings.
Chapter 2: Using Data.
3 - Variables Lingma Acheson Department of Computer and Information Science, IUPUI CSCI N331 VB.NET Programming.
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
ROUND 1 Name a method associated with class String 1.) 15 compareTo() 26 indexOf() 34 length() 2.) 3.) 4.) 3 toUpper() 7 substring() 11 charAt() 5.)
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
Characters. Character Data char data type – Represents one character – char literals indicated with ' '
Chapter 8: Manipulating Strings
Chapter 12: String Manipulation Introduction to Programming with C++ Fourth Edition.
Boolean Logic Logical Operators Comparison Operators Truth tables.
IFS Intro to Data Management Chapter 5 Getting More Than Simple Columns.
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.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter Eight String Manipulation.
INT213-Week-2 Working with Variables. What is variable
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.
1 Chapter 3 – Examples The examples from chapter 3, combining the data types, variables, expressions, assignments, functions and methods with Windows controls.
Variables Hold information that may be manipulated, used to manipulate other information or remembered for later use A storage location in memory (RAM)
CECS 5020 Computers in Education Visual Basic Variables and Constants.
CS4 –lecture 6 Wednesday, Jan 19, 2011 Roxana Gheorghiu.
© 2006 Lawrenceville Press Slide 1 Chapter 6 The Post-Test Do…Loop Statement  Loop structure that executes a set of statements as long as a condition.
VB.NET 2008 Introduction to Variables Part 1. Overview.NET Languages –Source Code –Compiler –MSIL –CLR & Windows Variables –Data Types –Converting.
Tutorial 8: Manipulating Strings1 Tutorial 8 Manipulating Strings.
CHAPTER FOUR Performing Calculations and Manipulating Data: Expressions.
© 2010 Lawrenceville Press Slide 1 Chapter 5 The Do…Loop Statement  Loop structure that executes a set of statements as long as a condition is true. 
Lecture Set 6 The String and DateTime Data Types Part B – Characters and Strings String Properties and Methods.
Introduction to Calculated Columns Variables, Conditionals, and String Manipulation PRESENTER: Cameron Blashka| Informer Implementation Specialist| April.
Objective 7.04 Apply Built-in String Functions (3%)
Arithmetic operations and operators, converting data types and formatting programs for output. Year 11 Information Technology.
An Application Uses Variables to Hold Information So It May Be Manipulated, Used to Manipulate Other Information, or Remembered for Later Use.
Visual Basic Variables
Operators Operators are symbols such as + (addition), - (subtraction), and * (multiplication). Operators do something with values. $foo = 25; $foo – 15;
Introduction to C++ October 2, 2017.
Chapter 6 Variables What is VBScript?
Chapter 5 The Do…Loop Statement
Review # 2 Math 8.
Divisibility Rules.
CIS16 Application Development and Programming using Visual Basic.net
Computing in COBOL: The Arithmetic Verbs and Intrinsic Functions
Microsoft Visual Basic 2005: Reloaded Second Edition
VB Variables and Data
Intro to Programming Concepts
Short Division.
Learning Intention I will learn about concatenation and arithmetic operators.
Visual Programming COMP-315
Switch, Strings, and ArrayLists in Java
String Manipulation.
Dr. Abraham Professor UTPA
Primitive Data Types and Operators
COMPUTING.
Programming Techniques
Presentation transcript:

VB Math All of your favorite mathematical operators are available in VB: + Addition - Subtraction * Multiplication / Division \ Integer Division Mod Modulo (remainder after integer division) ^ Exponentiation

Other Math Functions Trig functions, logarithms, and other advanced math functions are available in the Math class (built in to VB). To use these, just type the word “Math” followed by a period into your code; all of your options will appear in the intellisense drop-down list.

String Operator VB strings are powerful and easy to use. A string variable can hold extremely long strings (millions of characters). The basic string operator is the ampersand (&). It concatenates (puts together) two strings: Dim s As String = “Go “ Dim t As String = “Blue!” Dim u As String = s & t u will have the value “Go Blue!”

String Functions VB.NET offers many useful string functions Most can be accessed simply by typing a period after a string variable:

String Functions Some of the most useful string functions are: Length: how many characters in the string Contains: Boolean indicating if one string is inside another IndexOf: If one string is inside another, this tells you where it begins StartsWith, EndsWith: Boolean indicating whether one string begins or ends with another Insert, Remove, Replace: Common editing functions Substring: Pulls out a part of a string starting with a given character Split: Takes a string and creates an array of strings which are the original string divided up at a given character (like spaces for words or periods for sentences). ToUpper, ToLower: Converts the string’s case.

Shortcut assignment operators VB.NET supports shortcut operators (+=, -=, *=, /=, &=, etc.): A += B is the same as A = A + B X *= 4 is the same as X = X * 4 S &= “!” is the same as S = S & “!”