SlideShare a Scribd company logo
1 of 16
Download to read offline
Introduction to C#
/*ENTER PROPERTIES HERE MAIN (ARGUMENTS) { ENTER STUFF HERE }*/
Made by Arham Abbas
How to be a Programmer
Essentials:
• A Computer
• An OS
• An IDE
• You.
Requisites:
• Visual Studios 2015 or below.
• A problem solving brain
• Music or other ambience cancelling approaches
• An Internet connection
Pre-Requisites
Past programming experience
C# is…..
• A programming language with multiple paradigms .
• A high level language.
• A simple, modern, general-purpose, portable and robust language.
• A pretty cool tool to use.
Lets explain:
Your first Program
Hello World
using System;
using System.Collections.Generic;
namespace ConsoleApplication1
{
class FirstProgram
{
static void Main(string[] args)
{
string intro = "Hello ZUdin!!";
Console.WriteLine(intro);
Console.ReadKey();
}
}
}
There is a history why this is made to be the first program!
• using – Implementing another namespace into
your created namespace.
• namespace – a collection of classes.
• class - A collection of methods and expressions.
• Main – The function which acts as the entry point
for the program.
Data Types
These are the basic blocks which you will operate on
to create results.
The following are a few data types:
1. Integer
2. Float
3. Decimal
4. Long
5. Short
6. Byte
7. Char
8. String
9. Boolean
Advanced
10. Arrays
11. Dictionary
12. List
13. Object
14. Dynamic
15. Pointer
16. Null
Numerical – int, float, decimal, long, short, byte
Alphanumerial – char, string
Boolean – Boolean
Advanced –
i. Arrays – Either Numerical, Alphabetic or
Boolean.
ii. Dictionary – Either Numerical, Alpha or
Boolean
iii. List – Either Numeric, Alphabetic or Boolean.
iv. Object – Base type for all data types.
v. Dynamic – Any type. Bypassing the static field
vi. Pointer – Points at a reference object.
Operators
Perform operations on variables.
• Every function or method is a custom
operation.
• Basic mathematical operations
• + : Addition
• - : Subtraction
• / : Division
• * : Multiplication
• == : Equality
• != : Inequality
• <= : Greater than and equal to
• >= : Lesser than and equal to
• += : Add variable to self
• -= : Subtract variable from self
• ++ : Add 1 to self
• -- : Subtract 1 from self
• ! : NOT
• && : AND
• || : OR
• Advanced Operations
• Math.<Insert function name here>
• Other in-built functions
• Custom Functions
The little essentials
Comments:
Use them often for your future self’s sanity + others.
// This is for single line comments
/* We are
*Legion
* And we are a single unit.
This is a multi line comment*/
White Space:
This shows the user and the computer (sometimes) that
this part of the program is another function or method.
Whitespace can be created by the Tab key or 4
Spaces.
Whitespace methods modify space and
newline characters. Advanced uses for File
I/O might be taught in the course.
The curly bracket:
Used to define sections of the code.
Strongly coded language.
Each function, class and namespace has to be
followed by an opening and closing curly
bracket.
The semicolon:
Used to differentiate between lines of code.
Strongly coded syntax.
Functions: Ins and Outs
Functions are basically your custom operations within a class. Thus these operations can have inputted values in them
and they can output values to the calling method or statement.
private object SendAndReturn(int[] numbers, int num, etc.)
{
return objectvariable;
}
Data Type of the variable
which is returned via the
return statement in the
method/function.
Return Statement
followed by a
variable which has
type object.
Variables which are feeded into the
function/method. Can be as many as
possible. The data type is stated for
each variable in the function instance.
When calling, only the variable name is
written.
Functions
The MAIN function:
• This is the GOTO function for the compiler.
• The program starts and ends on this function.
• All other methods are sub-routines for this function.
• This function should be as small as possible for ease of debugging.
Custom functions:
• Called by the MAIN function.
• Values can be passed onto them and can be returned from them. (Single or multiple)
• Variables inside methods cannot be used outside them. They are only present when the method is called and
deleted when it ends.
• Can call other functions but cannot call on the MAIN function.
Access Modifiers
Static
A static function, unlike a regular (instance) function, is not associated with an instance of the class.
A static class is a class which can only contain static members, and therefore cannot be instantiated.
For example:
class SomeClass {
public int InstanceMethod() { return 1; }
public static int StaticMethod() { return 42; }
}
In order to call InstanceMethod, you need an instance of the class:
SomeClass instance = new SomeClass();
instance.InstanceMethod(); //Fine
instance.StaticMethod(); //Won't compile
SomeClass.InstanceMethod(); //Won't compile
SomeClass.StaticMethod(); //Fine
Loops and
Conditional
Statements
CODING IS DANGEROUS ,SO TAKE
THESE WITH YOU.
Iterating Codes
Writing the same code again and again is bad practice and is looked down on.
This is due to the following reasons:
1. Extra Lines of code makes it harder to navigate the code.
2. More Lines, More Errors.
3. Harder to understand .
4. Alternative are better.
Functions:
1. For Loop
2. For Each
3. While Loop
4. Do While
5. If Else Statement
6. Switch Statement
For this till here, do that.
for (int count = 0; count < 100; count++)
{
<Insert your Code here>
}
A normal incrementing for loop
There are several types of for loop variations.
These are some of them:
1. Incrementing
2. Decrement
3. Increment, step
4. Decrement, step
5. Function
6. Char
Looping inside a loop inside a loop and on and on. You can
have nigh endless amounts of them but what are you going
to use them for??
A normal 3 loop example would be going through all the
cells of a 3D array. Visualizing a 3D object would be easy
but what would happen when you start thinking about a 4D
object or more.
For Loops
for (int count = 0; count < 100; count++)
{
<Insert your Code here>
}
There are 3 statements in the for loop function which makes it
unique.
1. The first one initializes a variable or uses a variable or your
making. Here we initialize a variable called count which is
an int type with the value of 0
2. The second statement gives the compiler a condition where
the loop would end. Over here, we want it to run till the
point where it has reached 100 and it stops at 100.
3. The third statement tells the compiler that the variable
count will increase its value by 1 every step.
A FOR loop has certain condition where it has its
advantages and disadvantages. These are some:
1. All loops work with strings and char type but
a FOR loop is preferred for its syntax and
index variable.
2. It is often the fastest way to loop over large
sets of numbers. It is easy for the compiler to
optimize.
3. Nesting loops inside is confusing.
4. Optimization requires quite a lot of
brainstorming because faster methods are
not as simple as using a for loop.

More Related Content

What's hot

java in Aartificial intelligent by virat andodariya
java in Aartificial intelligent by virat andodariyajava in Aartificial intelligent by virat andodariya
java in Aartificial intelligent by virat andodariyaviratandodariya
 
JDT Embraces Lambda Expressions - EclipseCon North America 2014
JDT Embraces Lambda Expressions - EclipseCon North America 2014JDT Embraces Lambda Expressions - EclipseCon North America 2014
JDT Embraces Lambda Expressions - EclipseCon North America 2014Noopur Gupta
 
Functional programming with Java 8
Functional programming with Java 8Functional programming with Java 8
Functional programming with Java 8Talha Ocakçı
 
OCA Java SE 8 Exam Chapter 1 Java Building Blocks
OCA Java SE 8 Exam Chapter 1 Java Building BlocksOCA Java SE 8 Exam Chapter 1 Java Building Blocks
OCA Java SE 8 Exam Chapter 1 Java Building Blocksİbrahim Kürce
 
Functional programming principles and Java 8
Functional programming principles and Java 8Functional programming principles and Java 8
Functional programming principles and Java 8Dragos Balan
 
C# Programming: Fundamentals
C# Programming: FundamentalsC# Programming: Fundamentals
C# Programming: FundamentalsMahmoud Abdallah
 
2CPP08 - Overloading and Overriding
2CPP08 - Overloading and Overriding2CPP08 - Overloading and Overriding
2CPP08 - Overloading and OverridingMichael Heron
 
Command Line Arguments in C#
Command Line Arguments in C#Command Line Arguments in C#
Command Line Arguments in C#Ali Hassan
 
Command line arguments.21
Command line arguments.21Command line arguments.21
Command line arguments.21myrajendra
 
Java findamentals1
Java findamentals1Java findamentals1
Java findamentals1Todor Kolev
 
Java findamentals1
Java findamentals1Java findamentals1
Java findamentals1Todor Kolev
 
Java findamentals1
Java findamentals1Java findamentals1
Java findamentals1Todor Kolev
 
Functional programming in scala
Functional programming in scalaFunctional programming in scala
Functional programming in scalaStratio
 
Intro. to prog. c++
Intro. to prog. c++Intro. to prog. c++
Intro. to prog. c++KurdGul
 
Cracking OCA and OCP Java 8 Exams
Cracking OCA and OCP Java 8 ExamsCracking OCA and OCP Java 8 Exams
Cracking OCA and OCP Java 8 ExamsGanesh Samarthyam
 
What To Leave Implicit
What To Leave ImplicitWhat To Leave Implicit
What To Leave ImplicitMartin Odersky
 
Xtend - better java with -less- noise
Xtend - better java with -less- noiseXtend - better java with -less- noise
Xtend - better java with -less- noiseNeeraj Bhusare
 

What's hot (20)

java in Aartificial intelligent by virat andodariya
java in Aartificial intelligent by virat andodariyajava in Aartificial intelligent by virat andodariya
java in Aartificial intelligent by virat andodariya
 
Functions in Python
Functions in PythonFunctions in Python
Functions in Python
 
JDT Embraces Lambda Expressions - EclipseCon North America 2014
JDT Embraces Lambda Expressions - EclipseCon North America 2014JDT Embraces Lambda Expressions - EclipseCon North America 2014
JDT Embraces Lambda Expressions - EclipseCon North America 2014
 
Functional programming with Java 8
Functional programming with Java 8Functional programming with Java 8
Functional programming with Java 8
 
OCA Java SE 8 Exam Chapter 1 Java Building Blocks
OCA Java SE 8 Exam Chapter 1 Java Building BlocksOCA Java SE 8 Exam Chapter 1 Java Building Blocks
OCA Java SE 8 Exam Chapter 1 Java Building Blocks
 
Functional programming principles and Java 8
Functional programming principles and Java 8Functional programming principles and Java 8
Functional programming principles and Java 8
 
C# Programming: Fundamentals
C# Programming: FundamentalsC# Programming: Fundamentals
C# Programming: Fundamentals
 
2CPP08 - Overloading and Overriding
2CPP08 - Overloading and Overriding2CPP08 - Overloading and Overriding
2CPP08 - Overloading and Overriding
 
Command Line Arguments in C#
Command Line Arguments in C#Command Line Arguments in C#
Command Line Arguments in C#
 
Command line arguments.21
Command line arguments.21Command line arguments.21
Command line arguments.21
 
Java findamentals1
Java findamentals1Java findamentals1
Java findamentals1
 
Java findamentals1
Java findamentals1Java findamentals1
Java findamentals1
 
Java findamentals1
Java findamentals1Java findamentals1
Java findamentals1
 
Preparing for Scala 3
Preparing for Scala 3Preparing for Scala 3
Preparing for Scala 3
 
Functional Programming in Java
Functional Programming in JavaFunctional Programming in Java
Functional Programming in Java
 
Functional programming in scala
Functional programming in scalaFunctional programming in scala
Functional programming in scala
 
Intro. to prog. c++
Intro. to prog. c++Intro. to prog. c++
Intro. to prog. c++
 
Cracking OCA and OCP Java 8 Exams
Cracking OCA and OCP Java 8 ExamsCracking OCA and OCP Java 8 Exams
Cracking OCA and OCP Java 8 Exams
 
What To Leave Implicit
What To Leave ImplicitWhat To Leave Implicit
What To Leave Implicit
 
Xtend - better java with -less- noise
Xtend - better java with -less- noiseXtend - better java with -less- noise
Xtend - better java with -less- noise
 

Similar to Introduction to c first week slides

C++ question and answers
C++ question and answersC++ question and answers
C++ question and answersAdenKheire
 
Presentation 4th
Presentation 4thPresentation 4th
Presentation 4thConnex
 
CLEAN CODING AND DEVOPS Final.pptx
CLEAN CODING AND DEVOPS Final.pptxCLEAN CODING AND DEVOPS Final.pptx
CLEAN CODING AND DEVOPS Final.pptxJEEVANANTHAMG6
 
Presentation 1st
Presentation 1stPresentation 1st
Presentation 1stConnex
 
Chapter Introduction to Modular Programming.ppt
Chapter Introduction to Modular Programming.pptChapter Introduction to Modular Programming.ppt
Chapter Introduction to Modular Programming.pptAmanuelZewdie4
 
learn JAVA at ASIT with a placement assistance.
learn JAVA at ASIT with a placement assistance.learn JAVA at ASIT with a placement assistance.
learn JAVA at ASIT with a placement assistance.ASIT Education
 
Programming Language
Programming  LanguageProgramming  Language
Programming LanguageAdeel Hamid
 
ProgFund_Lecture_4_Functions_and_Modules-1.pdf
ProgFund_Lecture_4_Functions_and_Modules-1.pdfProgFund_Lecture_4_Functions_and_Modules-1.pdf
ProgFund_Lecture_4_Functions_and_Modules-1.pdflailoesakhan
 
11.C++Polymorphism [Autosaved].pptx
11.C++Polymorphism [Autosaved].pptx11.C++Polymorphism [Autosaved].pptx
11.C++Polymorphism [Autosaved].pptxAtharvPotdar2
 
Android webinar class_java_review
Android webinar class_java_reviewAndroid webinar class_java_review
Android webinar class_java_reviewEdureka!
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAAiman Hud
 
Concurrency Programming in Java - 02 - Essentials of Java Part 1
Concurrency Programming in Java - 02 - Essentials of Java Part 1Concurrency Programming in Java - 02 - Essentials of Java Part 1
Concurrency Programming in Java - 02 - Essentials of Java Part 1Sachintha Gunasena
 
Chapter One Function.pptx
Chapter One Function.pptxChapter One Function.pptx
Chapter One Function.pptxmiki304759
 

Similar to Introduction to c first week slides (20)

C++ question and answers
C++ question and answersC++ question and answers
C++ question and answers
 
CPP06 - Functions
CPP06 - FunctionsCPP06 - Functions
CPP06 - Functions
 
Introduction Of C++
Introduction Of C++Introduction Of C++
Introduction Of C++
 
Presentation 4th
Presentation 4thPresentation 4th
Presentation 4th
 
CLEAN CODING AND DEVOPS Final.pptx
CLEAN CODING AND DEVOPS Final.pptxCLEAN CODING AND DEVOPS Final.pptx
CLEAN CODING AND DEVOPS Final.pptx
 
Presentation 1st
Presentation 1stPresentation 1st
Presentation 1st
 
Java For Automation
Java   For AutomationJava   For Automation
Java For Automation
 
#_ varible function
#_ varible function #_ varible function
#_ varible function
 
Introduction to C ++.pptx
Introduction to C ++.pptxIntroduction to C ++.pptx
Introduction to C ++.pptx
 
Chapter Introduction to Modular Programming.ppt
Chapter Introduction to Modular Programming.pptChapter Introduction to Modular Programming.ppt
Chapter Introduction to Modular Programming.ppt
 
learn JAVA at ASIT with a placement assistance.
learn JAVA at ASIT with a placement assistance.learn JAVA at ASIT with a placement assistance.
learn JAVA at ASIT with a placement assistance.
 
Design p atterns
Design p atternsDesign p atterns
Design p atterns
 
Programming Language
Programming  LanguageProgramming  Language
Programming Language
 
ProgFund_Lecture_4_Functions_and_Modules-1.pdf
ProgFund_Lecture_4_Functions_and_Modules-1.pdfProgFund_Lecture_4_Functions_and_Modules-1.pdf
ProgFund_Lecture_4_Functions_and_Modules-1.pdf
 
11.C++Polymorphism [Autosaved].pptx
11.C++Polymorphism [Autosaved].pptx11.C++Polymorphism [Autosaved].pptx
11.C++Polymorphism [Autosaved].pptx
 
Android webinar class_java_review
Android webinar class_java_reviewAndroid webinar class_java_review
Android webinar class_java_review
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
Concurrency Programming in Java - 02 - Essentials of Java Part 1
Concurrency Programming in Java - 02 - Essentials of Java Part 1Concurrency Programming in Java - 02 - Essentials of Java Part 1
Concurrency Programming in Java - 02 - Essentials of Java Part 1
 
Chapter One Function.pptx
Chapter One Function.pptxChapter One Function.pptx
Chapter One Function.pptx
 
java.pptx
java.pptxjava.pptx
java.pptx
 

More from luqman bawany

More from luqman bawany (6)

Sensors
Sensors Sensors
Sensors
 
Random number generator based game
Random number generator based gameRandom number generator based game
Random number generator based game
 
CHOMSKEY'S UNIVERSAL GRAMMAR
CHOMSKEY'S UNIVERSAL GRAMMARCHOMSKEY'S UNIVERSAL GRAMMAR
CHOMSKEY'S UNIVERSAL GRAMMAR
 
Peizometer sensor
Peizometer sensorPeizometer sensor
Peizometer sensor
 
Self esteem
Self esteemSelf esteem
Self esteem
 
7Cs of COMMUNICATION
7Cs of COMMUNICATION7Cs of COMMUNICATION
7Cs of COMMUNICATION
 

Recently uploaded

Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 

Recently uploaded (20)

Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 

Introduction to c first week slides

  • 1. Introduction to C# /*ENTER PROPERTIES HERE MAIN (ARGUMENTS) { ENTER STUFF HERE }*/ Made by Arham Abbas
  • 2. How to be a Programmer Essentials: • A Computer • An OS • An IDE • You. Requisites: • Visual Studios 2015 or below. • A problem solving brain • Music or other ambience cancelling approaches • An Internet connection Pre-Requisites Past programming experience
  • 3. C# is….. • A programming language with multiple paradigms . • A high level language. • A simple, modern, general-purpose, portable and robust language. • A pretty cool tool to use.
  • 5. Your first Program Hello World using System; using System.Collections.Generic; namespace ConsoleApplication1 { class FirstProgram { static void Main(string[] args) { string intro = "Hello ZUdin!!"; Console.WriteLine(intro); Console.ReadKey(); } } } There is a history why this is made to be the first program! • using – Implementing another namespace into your created namespace. • namespace – a collection of classes. • class - A collection of methods and expressions. • Main – The function which acts as the entry point for the program.
  • 6. Data Types These are the basic blocks which you will operate on to create results. The following are a few data types: 1. Integer 2. Float 3. Decimal 4. Long 5. Short 6. Byte 7. Char 8. String 9. Boolean Advanced 10. Arrays 11. Dictionary 12. List 13. Object 14. Dynamic 15. Pointer 16. Null Numerical – int, float, decimal, long, short, byte Alphanumerial – char, string Boolean – Boolean Advanced – i. Arrays – Either Numerical, Alphabetic or Boolean. ii. Dictionary – Either Numerical, Alpha or Boolean iii. List – Either Numeric, Alphabetic or Boolean. iv. Object – Base type for all data types. v. Dynamic – Any type. Bypassing the static field vi. Pointer – Points at a reference object.
  • 7. Operators Perform operations on variables. • Every function or method is a custom operation. • Basic mathematical operations • + : Addition • - : Subtraction • / : Division • * : Multiplication • == : Equality • != : Inequality • <= : Greater than and equal to • >= : Lesser than and equal to • += : Add variable to self • -= : Subtract variable from self • ++ : Add 1 to self • -- : Subtract 1 from self • ! : NOT • && : AND • || : OR • Advanced Operations • Math.<Insert function name here> • Other in-built functions • Custom Functions
  • 8. The little essentials Comments: Use them often for your future self’s sanity + others. // This is for single line comments /* We are *Legion * And we are a single unit. This is a multi line comment*/ White Space: This shows the user and the computer (sometimes) that this part of the program is another function or method. Whitespace can be created by the Tab key or 4 Spaces. Whitespace methods modify space and newline characters. Advanced uses for File I/O might be taught in the course. The curly bracket: Used to define sections of the code. Strongly coded language. Each function, class and namespace has to be followed by an opening and closing curly bracket. The semicolon: Used to differentiate between lines of code. Strongly coded syntax.
  • 9. Functions: Ins and Outs Functions are basically your custom operations within a class. Thus these operations can have inputted values in them and they can output values to the calling method or statement. private object SendAndReturn(int[] numbers, int num, etc.) { return objectvariable; } Data Type of the variable which is returned via the return statement in the method/function. Return Statement followed by a variable which has type object. Variables which are feeded into the function/method. Can be as many as possible. The data type is stated for each variable in the function instance. When calling, only the variable name is written.
  • 10. Functions The MAIN function: • This is the GOTO function for the compiler. • The program starts and ends on this function. • All other methods are sub-routines for this function. • This function should be as small as possible for ease of debugging. Custom functions: • Called by the MAIN function. • Values can be passed onto them and can be returned from them. (Single or multiple) • Variables inside methods cannot be used outside them. They are only present when the method is called and deleted when it ends. • Can call other functions but cannot call on the MAIN function.
  • 12. Static A static function, unlike a regular (instance) function, is not associated with an instance of the class. A static class is a class which can only contain static members, and therefore cannot be instantiated. For example: class SomeClass { public int InstanceMethod() { return 1; } public static int StaticMethod() { return 42; } } In order to call InstanceMethod, you need an instance of the class: SomeClass instance = new SomeClass(); instance.InstanceMethod(); //Fine instance.StaticMethod(); //Won't compile SomeClass.InstanceMethod(); //Won't compile SomeClass.StaticMethod(); //Fine
  • 13. Loops and Conditional Statements CODING IS DANGEROUS ,SO TAKE THESE WITH YOU.
  • 14. Iterating Codes Writing the same code again and again is bad practice and is looked down on. This is due to the following reasons: 1. Extra Lines of code makes it harder to navigate the code. 2. More Lines, More Errors. 3. Harder to understand . 4. Alternative are better. Functions: 1. For Loop 2. For Each 3. While Loop 4. Do While 5. If Else Statement 6. Switch Statement
  • 15. For this till here, do that. for (int count = 0; count < 100; count++) { <Insert your Code here> } A normal incrementing for loop There are several types of for loop variations. These are some of them: 1. Incrementing 2. Decrement 3. Increment, step 4. Decrement, step 5. Function 6. Char Looping inside a loop inside a loop and on and on. You can have nigh endless amounts of them but what are you going to use them for?? A normal 3 loop example would be going through all the cells of a 3D array. Visualizing a 3D object would be easy but what would happen when you start thinking about a 4D object or more.
  • 16. For Loops for (int count = 0; count < 100; count++) { <Insert your Code here> } There are 3 statements in the for loop function which makes it unique. 1. The first one initializes a variable or uses a variable or your making. Here we initialize a variable called count which is an int type with the value of 0 2. The second statement gives the compiler a condition where the loop would end. Over here, we want it to run till the point where it has reached 100 and it stops at 100. 3. The third statement tells the compiler that the variable count will increase its value by 1 every step. A FOR loop has certain condition where it has its advantages and disadvantages. These are some: 1. All loops work with strings and char type but a FOR loop is preferred for its syntax and index variable. 2. It is often the fastest way to loop over large sets of numbers. It is easy for the compiler to optimize. 3. Nesting loops inside is confusing. 4. Optimization requires quite a lot of brainstorming because faster methods are not as simple as using a for loop.