Session4 csharp
-
Upload
muhammad-hesham -
Category
Technology
-
view
49 -
download
2
Transcript of Session4 csharp
AW
Prepared and presented by : Muhammad Hesham & Mustafa Saeed
Aspiration Webbers Session 4 (C#)
1.Reko meet C# (Brief history)
2.What C# can do (New Comers)
3.Architecture of .NET Applications4.Data types5.C# syntax
C#
New Comer
Editors
Visual Studio Code
IDE
Visual studio
CLR
Library
namespace
class
method
statement
Architecture of .NET Applications
Architecture of .NET Applications
namespace ConsoleApplication
using System;
public static void Main()
public class Program
Console.WriteLine("Hello World!");
Librarynamespaceclassmethodstatement
Data types
Syntax
// Comment
Variables Comments
/*Commentscomment
*/
int x = 20 ; String name = “Reko” ; char z = ‘R’ ;
Operators Addition+Subtraction-Multiplication*Division/Modulus%Increment
Decrement
++- -
int x = 2010% ;
int x = 2010- ; int x = 2010* ; int x = 2010/ ;
int x = 2010+ ;
x++; x--; int x =
int x =20;20 ;
And&&Or||
namespace
namespace ConsoleApp1{
}
Data Name
Age
Address
Actions Walk()
Talk()
Sleep()
Class
class
class Program{
}
namespace ConsoleApp1{
}
public class Person { public int Age { get; set; } public string FirstName { get; set; } public string LastName { get; set; }
public void WhatIsMyName() { }
public int Calculate(int firstNum, int secondNum) { } }
Object
Class
methodclass Program{
}
namespace ConsoleApp1{
}
static void Main(string[] args){
}
Person myPerson = new Person();
myPerson.FirstName = "Reko"; myPerson.LastName = "MSP"; myPerson.Age = 17;
myPerson.WhatIsMyName();
var result = myPerson.Calculate(10, 20); Console.WriteLine(result);
Object
method
public class Program{
}
namespace sessionFourDemo{
}
static void Main(string[] args) { Console.WriteLine(“Hello World”); }
method
public class Program{
}
namespace sessionFourDemo{
}
static void Main(string[] args) { String name = Console.ReadLine(); Console.WriteLine(name); }
New class New method
private class Person{
}
namespace sessionFourDemo{
}
public void WhatIsMyName() { Console.WriteLine(“Hello world"); }
public class Program{
}
namespace sessionFourDemo{
}
static void Main(string[] args) { Console.WriteLine(WhatIsMyName()); }
New class New method
public class Person{
}
namespace sessionFourDemo{
}
public int Calcu(int ftNum , int snNum) { return ftNum + snNum; }
public class Program{
}
namespace sessionFourDemo{
}
static void Main(string[] args) { Console.WriteLine(Calcu(5,3)); }
8
if
Switch
For .. Loop
While ..Loop
array
lists
For each
Demo
Any Questions ?
Contact : [email protected]
FB.com/groups/AWMSPCU17
Thank you