Documentos de Académico
Documentos de Profesional
Documentos de Cultura
program executes Declare and initialize a variable in one statement or assign a value immediately after you declare it Use camel notation as programming convention Example:
Naming Conventions
Start the names of variables with a lowercase letter ,
and capitalize the first letter of each word after first word, also called Camel Notation Capitalize the first letter of each word of a constant name, also called Pascal Notation
Arithmetic Expressions
Arithmetic Expression
An arithmetic expression consists of one or more
operands and arithmetic operators The first five binary operators above are called binary operators because they operate on two operands . The next four are called unary operators because they operate because they operate on just one operand
Assignment Operators
Order of Precedence
Increment and decrement 2. Positive and negative 3. Multiplication, division , and modulus 4. Addition and subtraction
1.
Math Class
Round method: Math.Round (decimalNumber[,precision]) Pow method Math.Pow(number, power) Sqrt method Math.Sqrt(number) Min and Max methods Math.{Min/Max}(number1,number2)
Strings
A string can consist of any character including
symbols String literal-value of string in closed quotes Null value-value of string is unknown Empty string-string with no value inside closed quotes Concatenation-join strings, uses the + sign Append-adding one string to another, += string is used
Escape sequences
\n new line
\t tab
\r carriage return \\ - backlash
\ - quotation
a class within the .NET framework. When you use a C# keyword to refer to a data type , youre actually using an alias associated structure or class A structure define a value type which stores its own data A class defines a reference type. A referenced type doesnt store and data itself. Instead, it stores a reference to the area of memory where data is stored All structures and classes shown are in the System namespace
How to use the Format method of the String class to format a number