SlideShare une entreprise Scribd logo
1  sur  46
Télécharger pour lire hors ligne
DR ATIF SHAHZAD
Computer Applications
in Industrial Engg.-I
IE-322
LECTURE #08
Computer Applications in
Industrial Engg.-I
IE322
…Recap
9/27/2018
Dr.AtifShahzad
What we will see…
9/27/2018
Dr.AtifShahzad
A Random Review
A quick Question
Classes
• Class vs Object:
Examples
• Class vs Object:
Adding a Class to a C#
project
Declaring a Class
Adding a Method to the
Class
Instantiating an object
of a class
Calling a Method of an
object
Complete Example—
class Car
Solution Explorer
Files of the project in
Windows explorer
Example2:
Some built-in classes
A BonusTopic
• Look this example
• Conditional Operator
What is aVisual Studio
Project?
What is aVisual Studio
Solution?
Project & Solution
A Random Review
Dr.AtifShahzad
5
Data types are sets
(ranges) of values that
have similar
characteristics.
A Random Review
Dr.AtifShahzad
6
DataTypes DefaultValue MinimumValue MaximumValue
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 - -
string null - -
A Random Review: Integer types
Dr.AtifShahzad
7
// Declare some variables
byte centuries = 20;
ushort years = 2000;
uint days = 730480;
ulong hours = 17531520;
// Print the result on the console
Console.WriteLine(centuries + " centuries are " + years +
" years, or " + days + " days, or " + hours + " hours.
");
// Console output:
// 20 centuries are 2000 years, or 730480 days, or 17531520
// hours.
ulong maxIntValue = UInt64.MaxValue;
Console.WriteLine(maxIntValue); // 18446744073709551615
A Random Review: Real types
Dr.AtifShahzad
8
// Declare some variables
float floatPI = 3.141592653589793238f;
double doublePI = 3.141592653589793238;
// Print the results on the console
Console.WriteLine("Float PI is: " + floatPI);
Console.WriteLine("Double PI is: " + doublePI);
// Console output:
// Float PI is: 3.141593
// Double PI is: 3.14159265358979
A quick Question
9/27/2018
Dr.AtifShahzad
9
int age = 8;
if ( !(age >= 16) )
{
Console.Write("Your age is less than 16");
}
//What is the OUTPUT?
A quick Question
int age = 8;
if ( !(age >= 16) ) {
Console.Write("Your age is less than 16");
}
// Outputs "Your age is less than 16"
9/27/2018
Dr.AtifShahzad
10
Classes
IE322
Classes
Classes act as templatesfrom which
an instance of an object is created at run time.
9/27/2018
Dr.AtifShahzad
12
Classes
Classes act as templates
from which
an instance of an object is created
at run time.
Classes define the properties of the object
and the methods used to control the
object's behavior.
9/27/2018
Dr.AtifShahzad
13
Class vs Object: Example 1
Dr.AtifShahzad
14
Drawing of House
House
Class vs Object: Example 2
Dr.AtifShahzad
15
Engineering Drawing of a car
Car
Class vs Object: Example 3
Dr.AtifShahzad
16
BankAccountclass
Bank Account of a customer
Class vs Object: Example 4
Dr.AtifShahzad
17
Student class
A particular student
Class vs Object:You examples?
Dr.AtifShahzad
18
Class:
Object:
Attributes:
Methods:
Class vs Object:
Dr.AtifShahzad
19
Class:
Object:
Attributes or States or Properties
these are the characteristics of the object which define it in a
way and describe it in general or in a specific moment
Methods or Behaviors
these are the specific distinctive actions, which can be done by
the object.
Methods:
Adding a Class to a C# project
Dr.AtifShahzad
20
Declaring a Class
Dr.AtifShahzad
21
Let us create a class named as Car
namespace CarApp
{
class Car
{
}
}
Declaring a Class
Dr.AtifShahzad
22
Let us create a class named as Car
namespace CarApp
{
class Car
{
} // end class Car
}//end namespace CarApp
Adding a Method to the Class
Dr.AtifShahzad
23
namespace CarApp
{
class Car
{
public void Start()
{ // A method
Console.WriteLine("Car has been
started");
}
} // end class Car
}//end namespace CarApp
Instantiating an object of a class
Dr.AtifShahzad
24
In the Main method of the Program:
Car MyCar = new Car();
Calling a Method of an object
Dr.AtifShahzad
25
Access or dot (.) operator
MyCar.Start();
Complete Example—class Car
Dr.AtifShahzad
26
Complete Example—class Program
Dr.AtifShahzad
27
Solution Explorer
Dr.AtifShahzad
28
Files of the project inWindows
explorer
9/27/2018
Dr.AtifShahzad
29
Example2:
Dr.AtifShahzad
30
public class Cat
{
// Field name
private string name;
// Field color
private string color;
public string Name
{
// Getter of the property "Name"
get
{
return this.name;
}
// Setter of the property "Name"
set
{
this.name = value;
}
}
public string Color
{
// Getter of the property "Color"
get
{
return this.color;
}
// Setter of the property "Color"
set
{
this.color = value;
}
}
// Default constructor
public Cat()
{
this.name = "Unnamed";
this.color = "gray";
}
// Constructor with parameters
public Cat(string name, string color)
{
this.name = name;
this.color = color;
}
// Method SayMiau
public void SayMiau()
{
Console.WriteLine("Cat {0} said: Miauuuuuu!", name);
}
}
public class Cat
{
// Field name
private string name;
// Field color
private string color;
public string Name
{
// Getter of the property "Name"
get
{
return this.name;
}
// Setter of the property "Name"
set
{
this.name = value;
}
}
public string Color
{
// Getter of the property "Color"
get
{
return this.color;
}
// Setter of the property "Color"
set
{
this.color = value;
}
}
// Default constructor
public Cat()
{
this.name = "Unnamed";
this.color = "gray";
}
// Constructor with parameters
public Cat(string name, string color)
{
this.name = name;
this.color = color;
}
// Method SayMiau
public void SayMiau()
{
Console.WriteLine("Cat {0} said: Miauuuuuu!
", name);
}
}
Some built-in classes
System.Console
System.String (string in C#)
System.Int32 (int in C#)
System.Array
System.Math
System.Random
9/27/2018
Dr.AtifShahzad
31
A BonusTopic
IE322
A BonusTopic
Conditional Operator
9/27/2018
Dr.AtifShahzad
33
Look at this example
int age = 42;
string msg;
if(age >= 18)
msg = "Welcome";
else
msg = "Sorry";
Console.WriteLine(msg);
9/27/2018
Dr.AtifShahzad
34
Conditional Operator
int age = 42;
string msg;
msg = (age >= 18) ? "Welcome" :
"Sorry";
Console.WriteLine(msg);
9/27/2018
Dr.AtifShahzad
35
Conditional Operator
What is the value of x after this code?
int x = 5;
int y = 3;
x = (x > y) ? y : x;
9/27/2018
Dr.AtifShahzad
36
Annex-
A Quick random revision
IE322
What is aVisual Studio Project?
When you create an
app, website, plug-in,
etc. inVisual Studio,
you start with a project.
9/27/2018
Dr.AtifShahzad
38
What is aVisual Studio Project?
When you create an app, website, plug-in, etc.
inVisual Studio, you start with a project.
In a logical sense, a project contains all the
source code files, icons, images, data files, etc.
that are compiled into an executable, library, or
website.
A project also contains compiler settings and
other configuration files that might be needed
by various services or components that your
program communicates with.9/27/2018
Dr.AtifShahzad
39
What is aVisual Studio Project?
A project is defined in an XML file with an
extension such as .vbproj, .csproj, or
.vcxproj.
This file contains a virtual folder hierarchy,
and paths to all the items in the project. It
also contains the build settings.
9/27/2018
Dr.AtifShahzad
40
What is aVisual Studio Project?
In Visual Studio, the project file is used by
Solution Explorer to display the project
contents and settings.
When you compile your project, the
MSBuild engine consumes the project file
to create the executable.You can also
customize projects to produce other kinds
of output.
9/27/2018
Dr.AtifShahzad
41
What is aVisual Studio Solution?
A project is contained within a solution. A
solution contains one or more related projects,
along with build information, Visual Studio
window settings, and any miscellaneous files
that aren't associated with a particular project.
A solution is described by a text file (extension
.sln) with its own unique format; it is generally
not intended to be edited by hand.
9/27/2018
Dr.AtifShahzad
42
What is aVisual Studio Solution?
A solution has an associated .suo file that stores
settings, preferences and configuration
information for each user that has worked on
the project.
9/27/2018
Dr.AtifShahzad
43
Project & Solution
9/27/2018
Dr.AtifShahzad
44
9/27/2018
Dr.AtifShahzad
46
NEVER hesitate to
contact should you
have any question
Dr.Atif Shahzad

Contenu connexe

Similaire à Lecture08 computer applicationsie1_dratifshahzad

Lecture09 computer applicationsie1_dratifshahzad
Lecture09 computer applicationsie1_dratifshahzadLecture09 computer applicationsie1_dratifshahzad
Lecture09 computer applicationsie1_dratifshahzadAtif Shahzad
 
Object Oriented Programming with C#
Object Oriented Programming with C#Object Oriented Programming with C#
Object Oriented Programming with C#SyedUmairAli9
 
classes object fgfhdfgfdgfgfgfgfdoop.pptx
classes object  fgfhdfgfdgfgfgfgfdoop.pptxclasses object  fgfhdfgfdgfgfgfgfdoop.pptx
classes object fgfhdfgfdgfgfgfgfdoop.pptxarjun431527
 
Data Seeding via Parameterized API Requests
Data Seeding via Parameterized API RequestsData Seeding via Parameterized API Requests
Data Seeding via Parameterized API RequestsRapidValue
 
Constructors and Destructors
Constructors and DestructorsConstructors and Destructors
Constructors and DestructorsKeyur Vadodariya
 
The Best Way to Become an Android Developer Expert with Android Jetpack
The Best Way to Become an Android Developer Expert  with Android JetpackThe Best Way to Become an Android Developer Expert  with Android Jetpack
The Best Way to Become an Android Developer Expert with Android JetpackAhmad Arif Faizin
 
Visual C++ project model
Visual C++ project modelVisual C++ project model
Visual C++ project modelPVS-Studio
 
Lecture13 ie321 dr_atifshahzad -algorithmic thinking
Lecture13 ie321 dr_atifshahzad -algorithmic thinkingLecture13 ie321 dr_atifshahzad -algorithmic thinking
Lecture13 ie321 dr_atifshahzad -algorithmic thinkingAtif Shahzad
 
Looking for Bugs in MonoDevelop
Looking for Bugs in MonoDevelopLooking for Bugs in MonoDevelop
Looking for Bugs in MonoDevelopPVS-Studio
 
Cmps 260, fall 2021 programming assignment #3 (125 points)
Cmps 260, fall 2021 programming assignment #3 (125 points)Cmps 260, fall 2021 programming assignment #3 (125 points)
Cmps 260, fall 2021 programming assignment #3 (125 points)mehek4
 
Introduction to Object oriented Design
Introduction to Object oriented DesignIntroduction to Object oriented Design
Introduction to Object oriented DesignAmin Shahnazari
 
Modeling Patterns for JavaScript Browser-Based Games
Modeling Patterns for JavaScript Browser-Based GamesModeling Patterns for JavaScript Browser-Based Games
Modeling Patterns for JavaScript Browser-Based GamesRay Toal
 
Tutorial mvc (pelajari ini jika ingin tahu mvc) keren
Tutorial mvc (pelajari ini jika ingin tahu mvc) kerenTutorial mvc (pelajari ini jika ingin tahu mvc) keren
Tutorial mvc (pelajari ini jika ingin tahu mvc) kerenSony Suci
 
Agile Data Science 2.0
Agile Data Science 2.0Agile Data Science 2.0
Agile Data Science 2.0Russell Jurney
 
DRESD Project Presentation - December 2006
DRESD Project Presentation - December 2006DRESD Project Presentation - December 2006
DRESD Project Presentation - December 2006santa
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfoliomwillmer
 
James Coplien: Trygve - Oct 17, 2016
James Coplien: Trygve - Oct 17, 2016James Coplien: Trygve - Oct 17, 2016
James Coplien: Trygve - Oct 17, 2016Foo Café Copenhagen
 

Similaire à Lecture08 computer applicationsie1_dratifshahzad (20)

Lecture09 computer applicationsie1_dratifshahzad
Lecture09 computer applicationsie1_dratifshahzadLecture09 computer applicationsie1_dratifshahzad
Lecture09 computer applicationsie1_dratifshahzad
 
Object Oriented Programming with C#
Object Oriented Programming with C#Object Oriented Programming with C#
Object Oriented Programming with C#
 
classes object fgfhdfgfdgfgfgfgfdoop.pptx
classes object  fgfhdfgfdgfgfgfgfdoop.pptxclasses object  fgfhdfgfdgfgfgfgfdoop.pptx
classes object fgfhdfgfdgfgfgfgfdoop.pptx
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
Data Seeding via Parameterized API Requests
Data Seeding via Parameterized API RequestsData Seeding via Parameterized API Requests
Data Seeding via Parameterized API Requests
 
Constructors and Destructors
Constructors and DestructorsConstructors and Destructors
Constructors and Destructors
 
The Best Way to Become an Android Developer Expert with Android Jetpack
The Best Way to Become an Android Developer Expert  with Android JetpackThe Best Way to Become an Android Developer Expert  with Android Jetpack
The Best Way to Become an Android Developer Expert with Android Jetpack
 
Visual C++ project model
Visual C++ project modelVisual C++ project model
Visual C++ project model
 
Lecture13 ie321 dr_atifshahzad -algorithmic thinking
Lecture13 ie321 dr_atifshahzad -algorithmic thinkingLecture13 ie321 dr_atifshahzad -algorithmic thinking
Lecture13 ie321 dr_atifshahzad -algorithmic thinking
 
Looking for Bugs in MonoDevelop
Looking for Bugs in MonoDevelopLooking for Bugs in MonoDevelop
Looking for Bugs in MonoDevelop
 
Cmps 260, fall 2021 programming assignment #3 (125 points)
Cmps 260, fall 2021 programming assignment #3 (125 points)Cmps 260, fall 2021 programming assignment #3 (125 points)
Cmps 260, fall 2021 programming assignment #3 (125 points)
 
Reversing JavaScript
Reversing JavaScriptReversing JavaScript
Reversing JavaScript
 
Introduction to Object oriented Design
Introduction to Object oriented DesignIntroduction to Object oriented Design
Introduction to Object oriented Design
 
Modeling Patterns for JavaScript Browser-Based Games
Modeling Patterns for JavaScript Browser-Based GamesModeling Patterns for JavaScript Browser-Based Games
Modeling Patterns for JavaScript Browser-Based Games
 
Tutorial mvc (pelajari ini jika ingin tahu mvc) keren
Tutorial mvc (pelajari ini jika ingin tahu mvc) kerenTutorial mvc (pelajari ini jika ingin tahu mvc) keren
Tutorial mvc (pelajari ini jika ingin tahu mvc) keren
 
Need 4 Speed FI
Need 4 Speed FINeed 4 Speed FI
Need 4 Speed FI
 
Agile Data Science 2.0
Agile Data Science 2.0Agile Data Science 2.0
Agile Data Science 2.0
 
DRESD Project Presentation - December 2006
DRESD Project Presentation - December 2006DRESD Project Presentation - December 2006
DRESD Project Presentation - December 2006
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
 
James Coplien: Trygve - Oct 17, 2016
James Coplien: Trygve - Oct 17, 2016James Coplien: Trygve - Oct 17, 2016
James Coplien: Trygve - Oct 17, 2016
 

Plus de Atif Shahzad

Lecture04 computer applicationsie1_dratifshahzad
Lecture04 computer applicationsie1_dratifshahzadLecture04 computer applicationsie1_dratifshahzad
Lecture04 computer applicationsie1_dratifshahzadAtif Shahzad
 
Lecture03 computer applicationsie1_dratifshahzad
Lecture03 computer applicationsie1_dratifshahzadLecture03 computer applicationsie1_dratifshahzad
Lecture03 computer applicationsie1_dratifshahzadAtif Shahzad
 
Lecture01 computer applicationsie1_dratifshahzad
Lecture01 computer applicationsie1_dratifshahzadLecture01 computer applicationsie1_dratifshahzad
Lecture01 computer applicationsie1_dratifshahzadAtif Shahzad
 
Lecture02 computer applicationsie1_dratifshahzad
Lecture02 computer applicationsie1_dratifshahzadLecture02 computer applicationsie1_dratifshahzad
Lecture02 computer applicationsie1_dratifshahzadAtif Shahzad
 
Lecture02 computer applicationsie1_dratifshahzad
Lecture02 computer applicationsie1_dratifshahzadLecture02 computer applicationsie1_dratifshahzad
Lecture02 computer applicationsie1_dratifshahzadAtif Shahzad
 
Dr atif shahzad_sys_ management_lecture_agile
Dr atif shahzad_sys_ management_lecture_agileDr atif shahzad_sys_ management_lecture_agile
Dr atif shahzad_sys_ management_lecture_agileAtif Shahzad
 
Dr atif shahzad_sys_ management_lecture_10_risk management_fmea_vmea
Dr atif shahzad_sys_ management_lecture_10_risk management_fmea_vmeaDr atif shahzad_sys_ management_lecture_10_risk management_fmea_vmea
Dr atif shahzad_sys_ management_lecture_10_risk management_fmea_vmeaAtif Shahzad
 
Dr atif shahzad_engg_ management_module_01
Dr atif shahzad_engg_ management_module_01Dr atif shahzad_engg_ management_module_01
Dr atif shahzad_engg_ management_module_01Atif Shahzad
 
Dr atif shahzad_engg_ management_lecture_inventory models
Dr atif shahzad_engg_ management_lecture_inventory modelsDr atif shahzad_engg_ management_lecture_inventory models
Dr atif shahzad_engg_ management_lecture_inventory modelsAtif Shahzad
 
Dr atif shahzad_engg_ management_lecture_inventory management
Dr atif shahzad_engg_ management_lecture_inventory managementDr atif shahzad_engg_ management_lecture_inventory management
Dr atif shahzad_engg_ management_lecture_inventory managementAtif Shahzad
 
Dr atif shahzad_engg_ management_cost management
Dr atif shahzad_engg_ management_cost managementDr atif shahzad_engg_ management_cost management
Dr atif shahzad_engg_ management_cost managementAtif Shahzad
 
Dr atif shahzad_sys_ management_lecture_outsourcing managing inter organizati...
Dr atif shahzad_sys_ management_lecture_outsourcing managing inter organizati...Dr atif shahzad_sys_ management_lecture_outsourcing managing inter organizati...
Dr atif shahzad_sys_ management_lecture_outsourcing managing inter organizati...Atif Shahzad
 
Lecture17 ie321 dr_atifshahzad_js
Lecture17 ie321 dr_atifshahzad_jsLecture17 ie321 dr_atifshahzad_js
Lecture17 ie321 dr_atifshahzad_jsAtif Shahzad
 
Lecture16 ie321 dr_atifshahzad_css
Lecture16 ie321 dr_atifshahzad_cssLecture16 ie321 dr_atifshahzad_css
Lecture16 ie321 dr_atifshahzad_cssAtif Shahzad
 
Lecture15 ie321 dr_atifshahzad_html
Lecture15 ie321 dr_atifshahzad_htmlLecture15 ie321 dr_atifshahzad_html
Lecture15 ie321 dr_atifshahzad_htmlAtif Shahzad
 
Lecture14 ie321 dr_atifshahzad -algorithmic thinking part2
Lecture14 ie321 dr_atifshahzad -algorithmic thinking part2Lecture14 ie321 dr_atifshahzad -algorithmic thinking part2
Lecture14 ie321 dr_atifshahzad -algorithmic thinking part2Atif Shahzad
 
Lecture12 ie321 dr_atifshahzad - networks
Lecture12 ie321 dr_atifshahzad - networksLecture12 ie321 dr_atifshahzad - networks
Lecture12 ie321 dr_atifshahzad - networksAtif Shahzad
 
Lecture11 ie321 dr_atifshahzad -security
Lecture11 ie321 dr_atifshahzad -securityLecture11 ie321 dr_atifshahzad -security
Lecture11 ie321 dr_atifshahzad -securityAtif Shahzad
 
Lecture10 ie321 dr_atifshahzad
Lecture10 ie321 dr_atifshahzadLecture10 ie321 dr_atifshahzad
Lecture10 ie321 dr_atifshahzadAtif Shahzad
 
Lecture08 ie321 dr_atifshahzad
Lecture08 ie321 dr_atifshahzadLecture08 ie321 dr_atifshahzad
Lecture08 ie321 dr_atifshahzadAtif Shahzad
 

Plus de Atif Shahzad (20)

Lecture04 computer applicationsie1_dratifshahzad
Lecture04 computer applicationsie1_dratifshahzadLecture04 computer applicationsie1_dratifshahzad
Lecture04 computer applicationsie1_dratifshahzad
 
Lecture03 computer applicationsie1_dratifshahzad
Lecture03 computer applicationsie1_dratifshahzadLecture03 computer applicationsie1_dratifshahzad
Lecture03 computer applicationsie1_dratifshahzad
 
Lecture01 computer applicationsie1_dratifshahzad
Lecture01 computer applicationsie1_dratifshahzadLecture01 computer applicationsie1_dratifshahzad
Lecture01 computer applicationsie1_dratifshahzad
 
Lecture02 computer applicationsie1_dratifshahzad
Lecture02 computer applicationsie1_dratifshahzadLecture02 computer applicationsie1_dratifshahzad
Lecture02 computer applicationsie1_dratifshahzad
 
Lecture02 computer applicationsie1_dratifshahzad
Lecture02 computer applicationsie1_dratifshahzadLecture02 computer applicationsie1_dratifshahzad
Lecture02 computer applicationsie1_dratifshahzad
 
Dr atif shahzad_sys_ management_lecture_agile
Dr atif shahzad_sys_ management_lecture_agileDr atif shahzad_sys_ management_lecture_agile
Dr atif shahzad_sys_ management_lecture_agile
 
Dr atif shahzad_sys_ management_lecture_10_risk management_fmea_vmea
Dr atif shahzad_sys_ management_lecture_10_risk management_fmea_vmeaDr atif shahzad_sys_ management_lecture_10_risk management_fmea_vmea
Dr atif shahzad_sys_ management_lecture_10_risk management_fmea_vmea
 
Dr atif shahzad_engg_ management_module_01
Dr atif shahzad_engg_ management_module_01Dr atif shahzad_engg_ management_module_01
Dr atif shahzad_engg_ management_module_01
 
Dr atif shahzad_engg_ management_lecture_inventory models
Dr atif shahzad_engg_ management_lecture_inventory modelsDr atif shahzad_engg_ management_lecture_inventory models
Dr atif shahzad_engg_ management_lecture_inventory models
 
Dr atif shahzad_engg_ management_lecture_inventory management
Dr atif shahzad_engg_ management_lecture_inventory managementDr atif shahzad_engg_ management_lecture_inventory management
Dr atif shahzad_engg_ management_lecture_inventory management
 
Dr atif shahzad_engg_ management_cost management
Dr atif shahzad_engg_ management_cost managementDr atif shahzad_engg_ management_cost management
Dr atif shahzad_engg_ management_cost management
 
Dr atif shahzad_sys_ management_lecture_outsourcing managing inter organizati...
Dr atif shahzad_sys_ management_lecture_outsourcing managing inter organizati...Dr atif shahzad_sys_ management_lecture_outsourcing managing inter organizati...
Dr atif shahzad_sys_ management_lecture_outsourcing managing inter organizati...
 
Lecture17 ie321 dr_atifshahzad_js
Lecture17 ie321 dr_atifshahzad_jsLecture17 ie321 dr_atifshahzad_js
Lecture17 ie321 dr_atifshahzad_js
 
Lecture16 ie321 dr_atifshahzad_css
Lecture16 ie321 dr_atifshahzad_cssLecture16 ie321 dr_atifshahzad_css
Lecture16 ie321 dr_atifshahzad_css
 
Lecture15 ie321 dr_atifshahzad_html
Lecture15 ie321 dr_atifshahzad_htmlLecture15 ie321 dr_atifshahzad_html
Lecture15 ie321 dr_atifshahzad_html
 
Lecture14 ie321 dr_atifshahzad -algorithmic thinking part2
Lecture14 ie321 dr_atifshahzad -algorithmic thinking part2Lecture14 ie321 dr_atifshahzad -algorithmic thinking part2
Lecture14 ie321 dr_atifshahzad -algorithmic thinking part2
 
Lecture12 ie321 dr_atifshahzad - networks
Lecture12 ie321 dr_atifshahzad - networksLecture12 ie321 dr_atifshahzad - networks
Lecture12 ie321 dr_atifshahzad - networks
 
Lecture11 ie321 dr_atifshahzad -security
Lecture11 ie321 dr_atifshahzad -securityLecture11 ie321 dr_atifshahzad -security
Lecture11 ie321 dr_atifshahzad -security
 
Lecture10 ie321 dr_atifshahzad
Lecture10 ie321 dr_atifshahzadLecture10 ie321 dr_atifshahzad
Lecture10 ie321 dr_atifshahzad
 
Lecture08 ie321 dr_atifshahzad
Lecture08 ie321 dr_atifshahzadLecture08 ie321 dr_atifshahzad
Lecture08 ie321 dr_atifshahzad
 

Dernier

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 

Dernier (20)

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 

Lecture08 computer applicationsie1_dratifshahzad

  • 1. DR ATIF SHAHZAD Computer Applications in Industrial Engg.-I IE-322 LECTURE #08
  • 4. What we will see… 9/27/2018 Dr.AtifShahzad A Random Review A quick Question Classes • Class vs Object: Examples • Class vs Object: Adding a Class to a C# project Declaring a Class Adding a Method to the Class Instantiating an object of a class Calling a Method of an object Complete Example— class Car Solution Explorer Files of the project in Windows explorer Example2: Some built-in classes A BonusTopic • Look this example • Conditional Operator What is aVisual Studio Project? What is aVisual Studio Solution? Project & Solution
  • 5. A Random Review Dr.AtifShahzad 5 Data types are sets (ranges) of values that have similar characteristics.
  • 6. A Random Review Dr.AtifShahzad 6 DataTypes DefaultValue MinimumValue MaximumValue 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 - - string null - -
  • 7. A Random Review: Integer types Dr.AtifShahzad 7 // Declare some variables byte centuries = 20; ushort years = 2000; uint days = 730480; ulong hours = 17531520; // Print the result on the console Console.WriteLine(centuries + " centuries are " + years + " years, or " + days + " days, or " + hours + " hours. "); // Console output: // 20 centuries are 2000 years, or 730480 days, or 17531520 // hours. ulong maxIntValue = UInt64.MaxValue; Console.WriteLine(maxIntValue); // 18446744073709551615
  • 8. A Random Review: Real types Dr.AtifShahzad 8 // Declare some variables float floatPI = 3.141592653589793238f; double doublePI = 3.141592653589793238; // Print the results on the console Console.WriteLine("Float PI is: " + floatPI); Console.WriteLine("Double PI is: " + doublePI); // Console output: // Float PI is: 3.141593 // Double PI is: 3.14159265358979
  • 9. A quick Question 9/27/2018 Dr.AtifShahzad 9 int age = 8; if ( !(age >= 16) ) { Console.Write("Your age is less than 16"); } //What is the OUTPUT?
  • 10. A quick Question int age = 8; if ( !(age >= 16) ) { Console.Write("Your age is less than 16"); } // Outputs "Your age is less than 16" 9/27/2018 Dr.AtifShahzad 10
  • 12. Classes Classes act as templatesfrom which an instance of an object is created at run time. 9/27/2018 Dr.AtifShahzad 12
  • 13. Classes Classes act as templates from which an instance of an object is created at run time. Classes define the properties of the object and the methods used to control the object's behavior. 9/27/2018 Dr.AtifShahzad 13
  • 14. Class vs Object: Example 1 Dr.AtifShahzad 14 Drawing of House House
  • 15. Class vs Object: Example 2 Dr.AtifShahzad 15 Engineering Drawing of a car Car
  • 16. Class vs Object: Example 3 Dr.AtifShahzad 16 BankAccountclass Bank Account of a customer
  • 17. Class vs Object: Example 4 Dr.AtifShahzad 17 Student class A particular student
  • 18. Class vs Object:You examples? Dr.AtifShahzad 18 Class: Object: Attributes: Methods:
  • 19. Class vs Object: Dr.AtifShahzad 19 Class: Object: Attributes or States or Properties these are the characteristics of the object which define it in a way and describe it in general or in a specific moment Methods or Behaviors these are the specific distinctive actions, which can be done by the object. Methods:
  • 20. Adding a Class to a C# project Dr.AtifShahzad 20
  • 21. Declaring a Class Dr.AtifShahzad 21 Let us create a class named as Car namespace CarApp { class Car { } }
  • 22. Declaring a Class Dr.AtifShahzad 22 Let us create a class named as Car namespace CarApp { class Car { } // end class Car }//end namespace CarApp
  • 23. Adding a Method to the Class Dr.AtifShahzad 23 namespace CarApp { class Car { public void Start() { // A method Console.WriteLine("Car has been started"); } } // end class Car }//end namespace CarApp
  • 24. Instantiating an object of a class Dr.AtifShahzad 24 In the Main method of the Program: Car MyCar = new Car();
  • 25. Calling a Method of an object Dr.AtifShahzad 25 Access or dot (.) operator MyCar.Start();
  • 29. Files of the project inWindows explorer 9/27/2018 Dr.AtifShahzad 29
  • 30. Example2: Dr.AtifShahzad 30 public class Cat { // Field name private string name; // Field color private string color; public string Name { // Getter of the property "Name" get { return this.name; } // Setter of the property "Name" set { this.name = value; } } public string Color { // Getter of the property "Color" get { return this.color; } // Setter of the property "Color" set { this.color = value; } } // Default constructor public Cat() { this.name = "Unnamed"; this.color = "gray"; } // Constructor with parameters public Cat(string name, string color) { this.name = name; this.color = color; } // Method SayMiau public void SayMiau() { Console.WriteLine("Cat {0} said: Miauuuuuu!", name); } } public class Cat { // Field name private string name; // Field color private string color; public string Name { // Getter of the property "Name" get { return this.name; } // Setter of the property "Name" set { this.name = value; } } public string Color { // Getter of the property "Color" get { return this.color; } // Setter of the property "Color" set { this.color = value; } } // Default constructor public Cat() { this.name = "Unnamed"; this.color = "gray"; } // Constructor with parameters public Cat(string name, string color) { this.name = name; this.color = color; } // Method SayMiau public void SayMiau() { Console.WriteLine("Cat {0} said: Miauuuuuu! ", name); } }
  • 31. Some built-in classes System.Console System.String (string in C#) System.Int32 (int in C#) System.Array System.Math System.Random 9/27/2018 Dr.AtifShahzad 31
  • 34. Look at this example int age = 42; string msg; if(age >= 18) msg = "Welcome"; else msg = "Sorry"; Console.WriteLine(msg); 9/27/2018 Dr.AtifShahzad 34
  • 35. Conditional Operator int age = 42; string msg; msg = (age >= 18) ? "Welcome" : "Sorry"; Console.WriteLine(msg); 9/27/2018 Dr.AtifShahzad 35
  • 36. Conditional Operator What is the value of x after this code? int x = 5; int y = 3; x = (x > y) ? y : x; 9/27/2018 Dr.AtifShahzad 36
  • 37. Annex- A Quick random revision IE322
  • 38. What is aVisual Studio Project? When you create an app, website, plug-in, etc. inVisual Studio, you start with a project. 9/27/2018 Dr.AtifShahzad 38
  • 39. What is aVisual Studio Project? When you create an app, website, plug-in, etc. inVisual Studio, you start with a project. In a logical sense, a project contains all the source code files, icons, images, data files, etc. that are compiled into an executable, library, or website. A project also contains compiler settings and other configuration files that might be needed by various services or components that your program communicates with.9/27/2018 Dr.AtifShahzad 39
  • 40. What is aVisual Studio Project? A project is defined in an XML file with an extension such as .vbproj, .csproj, or .vcxproj. This file contains a virtual folder hierarchy, and paths to all the items in the project. It also contains the build settings. 9/27/2018 Dr.AtifShahzad 40
  • 41. What is aVisual Studio Project? In Visual Studio, the project file is used by Solution Explorer to display the project contents and settings. When you compile your project, the MSBuild engine consumes the project file to create the executable.You can also customize projects to produce other kinds of output. 9/27/2018 Dr.AtifShahzad 41
  • 42. What is aVisual Studio Solution? A project is contained within a solution. A solution contains one or more related projects, along with build information, Visual Studio window settings, and any miscellaneous files that aren't associated with a particular project. A solution is described by a text file (extension .sln) with its own unique format; it is generally not intended to be edited by hand. 9/27/2018 Dr.AtifShahzad 42
  • 43. What is aVisual Studio Solution? A solution has an associated .suo file that stores settings, preferences and configuration information for each user that has worked on the project. 9/27/2018 Dr.AtifShahzad 43
  • 45.
  • 46. 9/27/2018 Dr.AtifShahzad 46 NEVER hesitate to contact should you have any question Dr.Atif Shahzad