session4 csharp

Post on 12-Apr-2017

64 Views

Category:

Technology

2 Downloads

Preview:

Click to see full reader

TRANSCRIPT

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 : phmustafasaeed@outlook.com

Muhammad.hesham7@outlook.com

FB.com/groups/AWMSPCU17

Thank you

top related