(i) Input and output
Console.ReadLine (); Input statement
Console.WriteLine (); Output Statement Wrap Line
Console.Write (); Output statement does not wrap
(ii) Notes
Comment Line
/* * * comment on an area
Put it on the function and annotate the function.
(c) Case
Console.Write ("Please enter Name:");
String name = Console.ReadLine ();
Console.Write ("Please enter Age:");
String age = Console.ReadLine ();
Console.Write ("Please enter work unit:");
String Danwei = Console.ReadLine ();
Console.Write ("Please Enter education:");
String Xueli = Console.ReadLine ();
Console.Write ("Please enter Gender:");
String Xingbie = Console.ReadLine ();
Console.Write ("Please enter your ID number:");
String sfz = Console.ReadLine ();
Console.WriteLine ("I call" + name + ", this year" + Age + "years old, in" + Danwei + "work");
Console.WriteLine ("My Education is" + Xueli + ", my gender is" + Xingbie + ", my ID number is" + SFZ + ");
(iv) Common data
Data type
Shaping: int Long
Float type: float double
Character type: Char
Boolean type: BOOL
String Type: String
Date Type: Date Time
Enum type: enum
struct type: struct
(v) Conversion
Automatic conversion (implicit conversion)-when converting from a value type to a reference type
Casts (explicit conversions)-when converting from a reference type to a value type, or from a floating-point type to an integral type
(vi) Classification precedence of operators
Arithmetic: + + (Gaga)-(minus) * (multiply)/(except)% (take-up) + (plus)-(minus)
Relationship:> (greater than) < (less than) >= (greater than or equal) <= (less than or equal)
Logic:&& (for (and)) | | (OR)! Non-
Conditional operator:? : (Only one ternary operator if)
Assignment: = + = = *=/=%= (for example: x-=4, or x=x-4)
Input output comment Case common data conversion constant operator classification precedence