Uploaded by Mehboob Arshad

WEEK01

advertisement
Enterprise Systems
WEEK01
MUHAMMAD NAEEM AKHTAR
PART-01
• Course Outline
• Grading Scheme.
• What is .NET?
• Installation
• Helloworld Program.
Installation & Hello world
• Download community edition of Visual Studio.
• You can use VS code as well.
• Hello world in VS
• Build and run
• Running from cmd
PART-02
Writing Code
• Check versions
• Go to view-> terminal and type
• For .NET core version: dotnet --version
• For compiler version: csc -langversion:?
• Variables
• string myVar=“Hello”;
• Similarly for char, int, uint(unsigned int), float=3.4F, double(same as float with different
range), decimal d=23.4M;. Float, double, decimal are for floating point with different ranges,
bool(true/false),
• Allowing null: int? var1=null; //var1 will show null instead of garbage.
• Always use decimal for accurate results instead of double. (See example code)
• Size of variables.
• Console.WriteLine(“int size”+sizeof(int)+ “bytes”);
• Console.WriteLine($”Mi size of int:{int.MinValue}”);
• Console.WriteLine($”Mi size of int:{int.MaxValue}”);
Download