Danh mục

Bài giảng Lập trình C# 2010: Chương 1.1 - ĐH Công nghệ Đồng Nai

Số trang: 17      Loại file: pptx      Dung lượng: 619.73 KB      Lượt xem: 8      Lượt tải: 0    
tailieu_vip

Hỗ trợ phí lưu trữ khi tải xuống: 6,000 VND Tải xuống file đầy đủ (17 trang) 0
Xem trước 2 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

Bài giảng Lập trình C# 2010: Chương 1.1 trình bày các nội dung về Working with Variables, Operators and Expressions (làm việc với biến, khai thác và những biểu hiện) trình bày các khái niệm, đặc điểm, công dụng và các nội dung khác.
Nội dung trích xuất từ tài liệu:
Bài giảng Lập trình C# 2010: Chương 1.1 - ĐH Công nghệ Đồng NaiDONG NAI UNIVERSITY OF TECHNOLOGY DONG NAI UNIVERSITY OF TECHNOLOGY Working with Variables,Operators and Expressions DONG NAI UNIVERSITY OF TECHNOLOGY1 2 3 Statement Identifiers Variables s - Comment4 5 Primitive Arithmeti s Data c Types Operators 6 7 Incrementing Implicitly & Typed Local Decrementing Variables Variables DONG NAI UNIVERSITY OF TECHNOLOGY -A Statement is a command that performs an action, you must add “;” the end of1 command Statement -Ex: Console.Write(“Hello s C# ”); -Comments use to explain - Comment for your Coding s How to write comments??? See next slide… DONG NAI UNIVERSITY OF TECHNOLOGY//Comment 1 /// ///Write Comment 4/* /// *Comment 2 /// private void func1(int a,float b) DONG NAI UNIVERSITY OF TECHNOLOGY Identifiers are names use to identify the elements in program, ex: namespace,2 class, method… Identifiers Syntax Rules: -Only use letter, digit, underscore -An identifier must start with a letter or an underscore -C# is a case –sensitive : nTest and ntest is different identifier DONG NAI UNIVERSITY OF TECHNOLOGY Identifying Keywordsabstract do in protected trueas double int public trybase else interface readonly typeofbool enum internal ref uintbreak event is return ulongbyte explicit lock sbyte uncheckedcase extern long sealed unsafecatch false namespace short ushortchar finally new sizeof usingchecked fixed null stackalloc virtualclass float object static voidconst for operator string volatilecontinue foreach out struct whiledecimal goto override switchdefault if params thisdelegate implicit private throwdynamic join setfrom let valueget orderby vargroup partial whereinto select yield DONG NAI UNIVERSITY OF TECHNOLOGY - A variable is storage location that holds a value. It as a box in the Computer’s memory3 holding temporary Variables information. -To easy coding: +Don’t start an identifier with underscore +Don’t different only by case ( nTest and ntest) +Start name with lower case +…. DONG NAI UNIVERSITY OF TECHNOLOGYHow to declare variables?Data_type NameVariable;int nNumberOfElement;string strFullName;float fValue=0,fResult; DONG NAI UNIVERSITY OF TECHNOLOGY 4 Primitive Data TypesDataType Description Size(bits) Range Example –231 through 231 –int Whole numbers 32 int nSize; 1 Whole numbers –263 through 263 –long 64 long lSize; (bigger range) 1 Floating-point ±1.5 × 1045 throughfloat 32 float fDelta; numbers ±3.4 × 1038 Double- precision (more ±5.0 × 10−324double accurate) 64 through ±1.7 × double dDelta; floating-point 10308 numbers Monetary decimaldecimal 128 28 signif ...

Tài liệu được xem nhiều: