3. …Recap
1/16/2019
Dr.AtifShahzad
• Page 1
• Interacting with Computers
• What is Programming?
– Programming Paradigms
– Motivation & Extent
• Object oriented programming
– Motivation--Reuse
– Concepts
• .NET framework
CLR as aVM
Source Code
Managed Code
MSIL
Executable
JIT Compiler
Machine Code
Machine
Language
Assembly
Language
High-Level
Language
Inheritance
Encapsulation
Polymorphism
4. What we will see…
1/16/2019
Dr.AtifShahzad
• Installation of VS2017 Community Edition on
your System
• IDEWalkthrough
We will consider Windows Operating System ONLY
5. Meanwhile the installation
progresses we will see…
1/16/2019
Dr.AtifShahzad
• Program structure and sequence
• Arithmetic operators
• Formatted output
• WriteLine(),Write(),ReadLine(),Read()
• DataTypes
– bool,byte,char,double,float,int,long,short,uint,ulong,
ushort
• Initialization of variables
• Your Examples
• Q&A
6. And…
1/16/2019
Dr.AtifShahzad
• Escape Sequence
• Comments,multi-line comments,Good practices
• var keyword
• Convert (data type conversion)
• Strings
• Operator precedence
• Your Examples
• Practice Quiz
• Q&A
28. F6
Compile the Solution
• Build Solution
F5
Run the solution
• Start Debugging
Ctrl+F5
Run the solution and
pause screen
• Start without Debugging
Ctrl+Shift+S
Save All
Ctrl+W,S
Solution Explorer
1/16/2019
Dr.AtifShahzad
28
Shortcut Keys
45. Variable
1/16/2019
Dr.AtifShahzad
• 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.
47. Variable
1/16/2019
Dr.AtifShahzad
When you
create a variable,
your program sets
aside enough
memory to hold the
value of the variable
And tags the
allocated memory
with that variable’s
name.
After creating a
variable,
you can use its name
in your program to
refer to the value it
represents.
48. Data type of a variable
Dr.AtifShahzad
48
Data types are sets
(ranges) of values that
have similar
characteristics.
57. Escape Sequence
is an escape character
n
t
r
”
1/16/2019
Dr.AtifShahzad
57
58. Reading some numeric data
Console.Write(“Enter first number”);
num1=Convert.ToInt32(Console.ReadLine())
1/16/2019
Dr.AtifShahzad
58
where num1 already defined as a number
59. Data Conversion
Convert.ToInt32()
Convert.ToDouble()
1/16/2019
Dr.AtifShahzad
59
ToBoolean
Converts a type to a Boolean value, where possible.
ToByte
Converts a type to a byte.
ToChar
Converts a type to a single Unicode character, where possible.
ToDateTime
Converts a type (integer or string type) to date-time structures.
ToDecimal
Converts a floating point or integer type to a decimal type.
ToDouble
Converts a type to a double type.
ToInt16
Converts a type to a 16-bit integer.
ToInt32
Converts a type to a 32-bit integer.
ToInt64
Converts a type to a 64-bit integer.
ToSbyte
Converts a type to a signed byte type.
ToSingle
Converts a type to a small floating point number.
ToString
Converts a type to a string.
ToType
Converts a type to a specified type.
ToUInt16
Converts a type to an unsigned int type.
ToUInt32
Converts a type to an unsigned long type.
ToUInt64
Converts a type to an unsigned big integer.