vbaspect - CIS 338: Operators and Formatting in VB.NET Dr....

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
CIS 338: Operators and Formatting in VB.NET Dr. Ralph D. Westfall February, 2009
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Things Can Do in Statements nAge = 57 (assign value) sValue = CStr(1234.56) (VB function) dPrice = ListPrice(dCost) (user function) [Call] PrintData(sStates()) (procedure) frmInput.Text = "Inputs" (set property) If nAge > 17 Then … (test value[s])
Background image of page 2
Assignment Statements nCount = 0 sState(1) = "AK" dTotal = dTotal + dItemCost or dTotal += dItemCost 'above is extremely common code pattern sFullName = "Abraham " & "Lincoln" 'concatenation sMonth = CStr(Month(Now)) '
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Math: Operator Precedence highest to lowest level (PEMDAS) 2. ( ) parentheses 3. ^ exponentiation (raise to a power) 4. negation (reverse the sign) 5. *, / multiply, divide 6. \ integer division (no decimals) 7. mod modulus arithmetic (remainder) 8. +, – add, subtract calculate left to right if on same level
Background image of page 4
Integer Division and Modulus \ gives integer part of result of dividing 2 integers e.g., 7\4 = 1 decimal numbers are rounded to integers mod gives remainder after integer division e.g., 7 mod 4 = 3
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/13/2009 for the course CIS 338 taught by Professor Westfall during the Winter '09 term at Cal Poly Pomona.

Page1 / 18

vbaspect - CIS 338: Operators and Formatting in VB.NET Dr....

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online