You are on page 1of 16

Generated by Foxit PDF Creator © Foxit Software

http://www.foxitsoftware.com For evaluation only.

} Windows API

} Visual Studio 6.0 : MFC Application, Visual

Basic 6.0

} Swing ( Java )

} Window Forms & C# 2.0 ( Microsoft .Net )


Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

• Getting started in C#
• Variable and data type

2/
15
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

} Getting started with C#

3/
15
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

} State the pitfalls of C/C++


} Define C# as a new language
} Describe purpose of C#
} Describe the .NET framework
} List & explain .NET framework
components

4/
15
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

} .NET Framework architecture


} Other components of .NET
Framework
} MSIL & CLR

5/
15
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

} Basic features
} Common applications of C#
} Advantages of C#
} Memory management & garbage
collections

6/
15
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

} Primary advantages
} Editions
} Languages
} Features

7/
15
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

} Key elements
} “csc” command
} Build and execute

8/
15
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

} Variables and Data types

9/
15
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

} Variable is an entity whose value can


keep changing.
} When a variable is declared, a data
type is assigned to the variable. In C#,
there are two data types :
◦ Value types
◦ Reference types

} Rules

10
/1
5
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

} C# supports 3 type of comments:


◦ Single-line comment
◦ Multi-line comment
◦ XML comment

11
/1
5
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

} Syntax to create XML document:


◦ Csc /doc:<XMLFile.xml> <CsharpFile.cs>
} Pre-define XML Tags

12
/1
5
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

} Constants :
◦ Fixed value, intitialised at declaration by
“const” keyword
◦ Ex: const float _pi = 3.14F;

} Literals:
◦ Static values assigned to constants or
variables
◦ 6 types :
– Boolean, Integer, Real, Character, String, Null
◦ Ex: bool val = true;
String email = null;
13
/1
5
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

} Keywords : reserved words convey a


pre-defined meaning to complier
} Escape sequences: special characters
prefixed by a back slash (\), used to
implement non-printing characters

14
/1
5
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

} Console application is one that


performs operation at command
prompt. There are 3 byte streams
attached to input, output devices:
standard in, out and err.
} Console output methods : write data on
console
◦ Console.Write()
◦ Console.WriteLine()
} Console input methods : read data
◦ Console.Read()
◦ Console.ReadLine() 15
/1
5
Generated by Foxit PDF Creator © Foxit Software
http://www.foxitsoftware.com For evaluation only.

} Format specifier : special characters


used to display values of variables in
particular way
◦ Numeric format specifier (C,D,E,F,N,X)
◦ Date/time format specifier(d,D,f,F,g,G,m or
M,t,T,y or Y)

16
/1
5