You are on page 1of 45

DR ATIF SHAHZAD

IE-322

Computer Applications
LECTURE #02 in Industrial Engg.-I
Computer Applications in
Industrial Engg.-I

IE322
…Recap Machine
Language

• Page 1 Assembly
Language
• Interacting with Computers High-Level
Language
• What is Programming?
– Programming Paradigms
– Motivation & Extent
• Object oriented programming Inheritance

– Motivation--Reuse CLR as a VM

Source Code Encapsulation


– Concepts Managed Code

• .NET framework MSIL Polymorphism


Dr. Atif Shahzad

Executable

JIT Compiler

Machine Code
7/1/2018
What we will see…
• Installation of VS2017 Community Edition on
your System
• IDE Walkthrough
Dr. Atif Shahzad

7/1/2018
Meanwhile the installation
progresses we will see…
• Program structure and sequence
• Arithmetic operators
• Formatted output
• WriteLine(),Write(),ReadLine(),Read()
• Data Types
– bool,byte,char,double,float,int,long,short,uint,ulong,
ushort
• Initialization of variables
• Your Examples
Dr. Atif Shahzad

• Q&A
7/1/2018
And…
• Escape Sequence
• Comments, multi-line comments, Good practices
• var keyword
• Convert (data type conversion)
• Strings
• Operator precedence
• Your Examples
• Practice Quiz
• Q&A
Dr. Atif Shahzad

7/1/2018
Computer Applications in
Industrial Engg.-I

IE322
Installation …
https://www.visualstudio.com/downloads/
Dr. Atif Shahzad

7/1/2018
Installation (Self-Explantory)
Dr. Atif Shahzad

7/1/2018
Installation…
Dr. Atif Shahzad

7/1/2018
Installation…
Dr. Atif Shahzad

7/1/2018
Installation…
Dr. Atif Shahzad

7/1/2018
Installation…
Dr. Atif Shahzad

7/1/2018
Installation…
Dr. Atif Shahzad

7/1/2018
Installation… (Optional)
Dr. Atif Shahzad

7/1/2018
Creating a Console App

IE322
C# Console App…New
Dr. Atif Shahzad

7/1/2018
C# Console App…Save
Dr. Atif Shahzad

7/1/2018
C# Console App
Dr. Atif Shahzad

7/1/2018
C# Console App
Dr. Atif Shahzad

7/1/2018
C# Console App…Compiling
Dr. Atif Shahzad

7/1/2018
C# Console App…Reopening
Dr. Atif Shahzad

7/1/2018
C# Console App…Reopening
Dr. Atif Shahzad

7/1/2018
C# Console App…Reopening
Dr. Atif Shahzad

7/1/2018
VS 2017 IDE
QuickWalkthrough

IE322
C# Console App…IDE
Dr. Atif Shahzad

7/1/2018
Intellisense
Dr. Atif Shahzad

7/1/2018
Indentation
Dr. Atif Shahzad

7/1/2018
Code Folding
Dr. Atif Shahzad

7/1/2018
Error Messages
Dr. Atif Shahzad

7/1/2018
Solution Explorer
Dr. Atif Shahzad

7/1/2018
Properties
Dr. Atif Shahzad

7/1/2018
Meanwhile the installation progresses
we will see…

IE322
Meanwhile the installation
progresses we will see…
• Variables
• Data Types
– bool,byte,char,double,float,int,long,short,uint,ulong,
ushort
• Program structure and sequence
• Comments, multi-line comments, Good practices
• WriteLine(),Write(),ReadLine(),Read()
• Initialization of variables
• Formatted output
• Your Examples
Dr. Atif Shahzad

• Q&A
7/1/2018
Variable
• A named area of computer memory.
–think of it as a named box that stores data
(including numbers and text) , for a
program to access as needed.
Dr. Atif Shahzad

7/1/2018
Variable
• variable named side whose current value is 50.
Dr. Atif Shahzad

7/1/2018
Variable
When you create After creating a
a variable, variable,

your program sets you can use its name


aside enough memory in your program to
to hold the value of refer to the value it
the variable represents.

And tags the allocated


memory with that
Dr. Atif Shahzad

variable’s name.

7/1/2018
Data type of a variable

Data types are sets


(ranges) of values that
have similar
characteristics.
Dr. Atif Shahzad

38
Data types
Data Types Default Value Minimum Value Maximum Value

sbyte 0 -128 127


byte 0 0 255
short 0 -32768 32767
ushort 0 0 65535
int 0 -2147483648 2147483647
uint 0u 0 4294967295
long 0L -9223372036854775808 9223372036854775807
ulong 0u 0 18446744073709551615
float 0.0f ±1.5×10-45 ±3.4×1038
double 0.0d ±5.0×10-324 ±1.7×10308
decimal 0.0m ±1.0×10-28 ±7.9×1028
bool false Two possible values: true and false

char '\u0000' '\u0000' '\uffff'


object null - -
Dr. Atif Shahzad

string null - -

39
C#-- A quick code walkthrough
Dr. Atif Shahzad

7/1/2018 40
And…
• Arithmetic operators
• Operator precedence
• Escape Sequence
• var keyword
• Convert (data type conversion)
• Strings
• Your Examples
• Practice Quiz
• Q&A
Dr. Atif Shahzad

7/1/2018
A Quick question
Fill the blanks to have x equal 15
Dr. Atif Shahzad

7/1/2018
A Quick question
Fill the blanks to have x equal 15
Dr. Atif Shahzad

7/1/2018
NEVER hesitate to
contact should you
have any question
Dr. Atif Shahzad
Dr. Atif Shahzad

7/1/2018 45

You might also like