SlideShare une entreprise Scribd logo
1  sur  34
Introduction ttoo PPrrooggrraammmmiinngg 
LLeeccttuurree ## 4433
Math Library 
 Complex number 
 Matrix 
 Quadratic equation and their solution 
…………….…
DDeessiiggnn RReecciippee 
 TToo ddeessiiggnn aa pprrooggrraamm pprrooppeerrllyy,, wwee mmuusstt :: 
– AAnnaallyyzzee aa pprroobblleemm ssttaatteemmeenntt,, ttyyppiiccaallllyy 
eexxpprreesssseedd aass aa wwoorrdd pprroobblleemm 
– EExxpprreessss iittss eesssseennccee,, aabbssttrraaccttllyy aanndd wwiitthh 
eexxaammpplleess 
– FFoorrmmuullaattee ssttaatteemmeennttss aanndd ccoommmmeennttss iinn aa 
pprreecciissee llaanngguuaaggee ii..ee.. ccooddee 
– EEvvaalluuaattee aanndd rreevviissee tthhee aaccttiivviittiieess iinn lliigghhtt 
ooff cchheecckkss aanndd tteessttss aanndd 
– PPAAYY AATTTTEENNTTIIOONN TTOO DDEETTAAIILL
Matrix 
• Matrix is nothing but a two 
dimensional array of numbers 
• Normally, represented in the 
form of : 
• Rows 
• Columns
Example 
1 2 3 4 
5 6 7 8 
9 10 11 12 
A = 
Three Rows 
Four Columns
i & j are two Integers 
i representing the Row number 
j representing the Column number
Operations Performed with Matrix 
• Addition of two matrices. 
• Addition of a scalar and a matrix 
• Subtraction of two matrices 
• Subtraction of a scalar from a matrix 
• Multiplication of two matrices 
• Multiplication of a scalar with a matrix 
• Division of a scalar with a matrix 
• Transpose of a matrix
Interface
Addition of two Matrices 
Aij+Bij = Cij
Addition of two Matrices 
Size of two matrices must be 
same 
Number of rows and columns 
must be identical for the 
matrices to be addable
Example 
1 2 3 
5 6 7 
9 10 11 
- 
3 6 8 
7 4 7 
9 10 1 
= 
-2 -4 -5 
-2 2 0 
0 0 10 
Cij = Aij - Bij
Adding a Scalar to 
the Matrix 
Ordinary number 
added to every 
element of the 
matrix
Subtracting a Scalar 
from a Matrix 
Ordinary number 
subtracted from 
every element of the 
matrix
Division of Matrix 
by a Scalar 
Divide every element 
of Matrix by a scalar 
number
Example 
Let : 
X be a Scalar number 
A be a Matrix 
C = 
Aij ij 
X
Multiplication of a scalar with a Matrix Example 
Let : 
X is a Scalar number 
A is a Matrix 
X * A 
X * Aij = Cij
Multiply two 
Matrices 
1 2 
* 2 4 
5 6 1 2 
= ( 1 ) ( 2 ) + ( 2 ) ( 1 ) ( 1 ) ( 4 ) + ( 2 ) ( 2 ) 
( 5 ) ( 2 ) + ( 6 ) ( 1 ) ( 5 ) ( 4 ) + ( 6 ) ( 2 )
Rules Regarding 
Matrix Multiplication 
Number of columns of the 1st Matrix 
= 
Number of rows of the 2nd Matrix
Rules rreeggaarrddiinngg MMaattrriixx 
MMuullttiipplliiccaattiioonn 
 FFiirrsstt mmaattrriixx hhaass 
– MM rroowwss 
– NN ccoolluummnnss 
 SSeeccoonndd mmaattrriixx hhaass 
– NN rroowwss 
– PP ccoolluummnnss 
 RReessuullttaanntt mmaattrriixx wwiillll hhaavvee 
– MM rroowwss 
– PP ccoolluummnnss
Transpose of a 
Matrix 
Interchange of rows 
and columns
Transpose of a Matrix 
Example 
1 2 3 
5 6 7 
9 10 11 
1 5 9 
2 6 10 
3 7 11
Transpose of a Non 
Square Matrix 
Size of matrix change after transpose 
A AT 
3 ( Rows ) * 4 ( Columns ) 
Before 
4 ( Rows ) * 3 ( Columns ) 
After
Next Phase of 
Analysis 
• Determine the Constants 
• Memory Allocation 
• What is it’s user interface
Interface
IInntteerrffaaccee 
CCoonnssttrruuccttoorr :: PPaarraammeetteerrss aarree 
NNuummbbeerr ooff rroowwss 
NNuummbbeerr ooff ccoolluummnnss 
DDiissppllaayy ffuunnccttiioonn 
PPlluuss ooppeerraattoorr :: mmeemmbbeerr ooppeerraattoorr ooff tthhee ccllaassss 
SSuubbttrraaccttiioonn ooppeerraattoorr :: mmeemmbbeerr ooppeerraattoorr ooff tthhee 
ccllaassss 
PPlluuss ooppeerraattoorr :: ffrriieenndd ooff tthhee ccllaassss 
SSuubbttrraaccttiioonn ooppeerraattoorr :: ffrriieenndd ooff tthhee ccllaassss
Plus Operator 
A + X 
X + A
Subtraction Operator 
A - X 
X – A
*
IInntteerrffaaccee 
MMuullttiipplliiccaattiioonn OOppeerraattoorr :: MMeemmbbeerr ooff tthhee CCllaassss 
MMuullttiipplliiccaattiioonn OOppeerraattoorr :: FFrriieenndd ooff tthhee CCllaassss 
DDiivviissiioonn OOppeerraattoorr :: MMeemmbbeerr ooff tthhee CCllaassss 
TTrraannssppoossee FFuunnccttiioonn :: MMeemmbbeerr ooff tthhee CCllaassss 
AAssssiiggnnmmeenntt OOppeerraattoorr :: MMeemmbbeerr ooff tthhee CCllaassss 
++== ,, --== :: MMeemmbbeerrss ooff tthhee CCllaassss
Multiplication Operator 
A * X 
X * A
Assignment Operator 
A = B ( Member Operator )
Interface 
>> Extraction Operator : Friend Operator 
<< Stream Insertion Operator : Friend Operator
Copy Constructor
 CCooppyy CCoonnssttrruuccttoorr 
 AAssssiiggnnmmeenntt 
OOppeerraattoorr 
 MMeemmoorryy AAllllooccaattiioonn 
 MMeemmoorryy 
DDeeaallllooccaattiioonn

Contenu connexe

En vedette

CS201- Introduction to Programming- Lecture 45
CS201- Introduction to Programming- Lecture 45CS201- Introduction to Programming- Lecture 45
CS201- Introduction to Programming- Lecture 45Bilal Ahmed
 
ISL201 - Islamic Studies- Lecture 15
ISL201 - Islamic Studies- Lecture 15ISL201 - Islamic Studies- Lecture 15
ISL201 - Islamic Studies- Lecture 15Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 44
CS201- Introduction to Programming- Lecture 44CS201- Introduction to Programming- Lecture 44
CS201- Introduction to Programming- Lecture 44Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 26
CS201- Introduction to Programming- Lecture 26CS201- Introduction to Programming- Lecture 26
CS201- Introduction to Programming- Lecture 26Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 15
CS201- Introduction to Programming- Lecture 15CS201- Introduction to Programming- Lecture 15
CS201- Introduction to Programming- Lecture 15Bilal Ahmed
 
CS101- Introduction to Computing- Lecture 31
CS101- Introduction to Computing- Lecture 31CS101- Introduction to Computing- Lecture 31
CS101- Introduction to Computing- Lecture 31Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 35
CS201- Introduction to Programming- Lecture 35CS201- Introduction to Programming- Lecture 35
CS201- Introduction to Programming- Lecture 35Bilal Ahmed
 
MGT101 - Financial Accounting- Lecture 36
MGT101 - Financial Accounting- Lecture 36MGT101 - Financial Accounting- Lecture 36
MGT101 - Financial Accounting- Lecture 36Bilal Ahmed
 
MGT101 - Financial Accounting- Lecture 30
MGT101 - Financial Accounting- Lecture 30MGT101 - Financial Accounting- Lecture 30
MGT101 - Financial Accounting- Lecture 30Bilal Ahmed
 
MGT101 - Financial Accounting- Lecture 45
MGT101 - Financial Accounting- Lecture 45MGT101 - Financial Accounting- Lecture 45
MGT101 - Financial Accounting- Lecture 45Bilal Ahmed
 
ENG101- English Comprehension- Lecture 45
ENG101- English Comprehension- Lecture 45ENG101- English Comprehension- Lecture 45
ENG101- English Comprehension- Lecture 45Bilal Ahmed
 
CS101- Introduction to Computing- Lecture 37
CS101- Introduction to Computing- Lecture 37CS101- Introduction to Computing- Lecture 37
CS101- Introduction to Computing- Lecture 37Bilal Ahmed
 
CS101- Introduction to Computing- Lecture 44
CS101- Introduction to Computing- Lecture 44CS101- Introduction to Computing- Lecture 44
CS101- Introduction to Computing- Lecture 44Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 37
CS201- Introduction to Programming- Lecture 37CS201- Introduction to Programming- Lecture 37
CS201- Introduction to Programming- Lecture 37Bilal Ahmed
 
MGT101 - Financial Accounting- Lecture 27
MGT101 - Financial Accounting- Lecture 27MGT101 - Financial Accounting- Lecture 27
MGT101 - Financial Accounting- Lecture 27Bilal Ahmed
 
CS101- Introduction to Computing- Lecture 39
CS101- Introduction to Computing- Lecture 39CS101- Introduction to Computing- Lecture 39
CS101- Introduction to Computing- Lecture 39Bilal Ahmed
 
CS101- Introduction to Computing- Lecture 35
CS101- Introduction to Computing- Lecture 35CS101- Introduction to Computing- Lecture 35
CS101- Introduction to Computing- Lecture 35Bilal Ahmed
 
CS101- Introduction to Computing- Lecture 43
CS101- Introduction to Computing- Lecture 43CS101- Introduction to Computing- Lecture 43
CS101- Introduction to Computing- Lecture 43Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 25
CS201- Introduction to Programming- Lecture 25CS201- Introduction to Programming- Lecture 25
CS201- Introduction to Programming- Lecture 25Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 03
CS201- Introduction to Programming- Lecture 03CS201- Introduction to Programming- Lecture 03
CS201- Introduction to Programming- Lecture 03Bilal Ahmed
 

En vedette (20)

CS201- Introduction to Programming- Lecture 45
CS201- Introduction to Programming- Lecture 45CS201- Introduction to Programming- Lecture 45
CS201- Introduction to Programming- Lecture 45
 
ISL201 - Islamic Studies- Lecture 15
ISL201 - Islamic Studies- Lecture 15ISL201 - Islamic Studies- Lecture 15
ISL201 - Islamic Studies- Lecture 15
 
CS201- Introduction to Programming- Lecture 44
CS201- Introduction to Programming- Lecture 44CS201- Introduction to Programming- Lecture 44
CS201- Introduction to Programming- Lecture 44
 
CS201- Introduction to Programming- Lecture 26
CS201- Introduction to Programming- Lecture 26CS201- Introduction to Programming- Lecture 26
CS201- Introduction to Programming- Lecture 26
 
CS201- Introduction to Programming- Lecture 15
CS201- Introduction to Programming- Lecture 15CS201- Introduction to Programming- Lecture 15
CS201- Introduction to Programming- Lecture 15
 
CS101- Introduction to Computing- Lecture 31
CS101- Introduction to Computing- Lecture 31CS101- Introduction to Computing- Lecture 31
CS101- Introduction to Computing- Lecture 31
 
CS201- Introduction to Programming- Lecture 35
CS201- Introduction to Programming- Lecture 35CS201- Introduction to Programming- Lecture 35
CS201- Introduction to Programming- Lecture 35
 
MGT101 - Financial Accounting- Lecture 36
MGT101 - Financial Accounting- Lecture 36MGT101 - Financial Accounting- Lecture 36
MGT101 - Financial Accounting- Lecture 36
 
MGT101 - Financial Accounting- Lecture 30
MGT101 - Financial Accounting- Lecture 30MGT101 - Financial Accounting- Lecture 30
MGT101 - Financial Accounting- Lecture 30
 
MGT101 - Financial Accounting- Lecture 45
MGT101 - Financial Accounting- Lecture 45MGT101 - Financial Accounting- Lecture 45
MGT101 - Financial Accounting- Lecture 45
 
ENG101- English Comprehension- Lecture 45
ENG101- English Comprehension- Lecture 45ENG101- English Comprehension- Lecture 45
ENG101- English Comprehension- Lecture 45
 
CS101- Introduction to Computing- Lecture 37
CS101- Introduction to Computing- Lecture 37CS101- Introduction to Computing- Lecture 37
CS101- Introduction to Computing- Lecture 37
 
CS101- Introduction to Computing- Lecture 44
CS101- Introduction to Computing- Lecture 44CS101- Introduction to Computing- Lecture 44
CS101- Introduction to Computing- Lecture 44
 
CS201- Introduction to Programming- Lecture 37
CS201- Introduction to Programming- Lecture 37CS201- Introduction to Programming- Lecture 37
CS201- Introduction to Programming- Lecture 37
 
MGT101 - Financial Accounting- Lecture 27
MGT101 - Financial Accounting- Lecture 27MGT101 - Financial Accounting- Lecture 27
MGT101 - Financial Accounting- Lecture 27
 
CS101- Introduction to Computing- Lecture 39
CS101- Introduction to Computing- Lecture 39CS101- Introduction to Computing- Lecture 39
CS101- Introduction to Computing- Lecture 39
 
CS101- Introduction to Computing- Lecture 35
CS101- Introduction to Computing- Lecture 35CS101- Introduction to Computing- Lecture 35
CS101- Introduction to Computing- Lecture 35
 
CS101- Introduction to Computing- Lecture 43
CS101- Introduction to Computing- Lecture 43CS101- Introduction to Computing- Lecture 43
CS101- Introduction to Computing- Lecture 43
 
CS201- Introduction to Programming- Lecture 25
CS201- Introduction to Programming- Lecture 25CS201- Introduction to Programming- Lecture 25
CS201- Introduction to Programming- Lecture 25
 
CS201- Introduction to Programming- Lecture 03
CS201- Introduction to Programming- Lecture 03CS201- Introduction to Programming- Lecture 03
CS201- Introduction to Programming- Lecture 03
 

Similaire à CS201- Introduction to Programming- Lecture 43

Chapter 3: Linear Systems and Matrices - Part 2/Slides
Chapter 3: Linear Systems and Matrices - Part 2/SlidesChapter 3: Linear Systems and Matrices - Part 2/Slides
Chapter 3: Linear Systems and Matrices - Part 2/SlidesChaimae Baroudi
 
Petri Nets: Properties, Analysis and Applications
Petri Nets: Properties, Analysis and ApplicationsPetri Nets: Properties, Analysis and Applications
Petri Nets: Properties, Analysis and ApplicationsDr. Mohamed Torky
 
Ebook mst209 block3_e1i1_n9780749252830_l1 (2)
Ebook mst209 block3_e1i1_n9780749252830_l1 (2)Ebook mst209 block3_e1i1_n9780749252830_l1 (2)
Ebook mst209 block3_e1i1_n9780749252830_l1 (2)Fred Stanworth
 
STate Space Analysis
STate Space AnalysisSTate Space Analysis
STate Space AnalysisHussain K
 
Kaizen cso002 l1
Kaizen cso002 l1Kaizen cso002 l1
Kaizen cso002 l1asslang
 
A Method for the Reduction 0f Linear High Order MIMO Systems Using Interlacin...
A Method for the Reduction 0f Linear High Order MIMO Systems Using Interlacin...A Method for the Reduction 0f Linear High Order MIMO Systems Using Interlacin...
A Method for the Reduction 0f Linear High Order MIMO Systems Using Interlacin...IJMTST Journal
 
03 programming 1
03 programming 103 programming 1
03 programming 1Tareq Qazi
 
A Parallel Direct Method For Solving Initial Value Problems For Ordinary Diff...
A Parallel Direct Method For Solving Initial Value Problems For Ordinary Diff...A Parallel Direct Method For Solving Initial Value Problems For Ordinary Diff...
A Parallel Direct Method For Solving Initial Value Problems For Ordinary Diff...Katie Naple
 
THE LEFT AND RIGHT BLOCK POLE PLACEMENT COMPARISON STUDY: APPLICATION TO FLIG...
THE LEFT AND RIGHT BLOCK POLE PLACEMENT COMPARISON STUDY: APPLICATION TO FLIG...THE LEFT AND RIGHT BLOCK POLE PLACEMENT COMPARISON STUDY: APPLICATION TO FLIG...
THE LEFT AND RIGHT BLOCK POLE PLACEMENT COMPARISON STUDY: APPLICATION TO FLIG...ieijjournal
 
THE LEFT AND RIGHT BLOCK POLE PLACEMENT COMPARISON STUDY: APPLICATION TO FLIG...
THE LEFT AND RIGHT BLOCK POLE PLACEMENT COMPARISON STUDY: APPLICATION TO FLIG...THE LEFT AND RIGHT BLOCK POLE PLACEMENT COMPARISON STUDY: APPLICATION TO FLIG...
THE LEFT AND RIGHT BLOCK POLE PLACEMENT COMPARISON STUDY: APPLICATION TO FLIG...ieijjournal1
 
Explicit model predictive control of fast dynamic system
Explicit model predictive control of fast dynamic systemExplicit model predictive control of fast dynamic system
Explicit model predictive control of fast dynamic systemeSAT Journals
 
Explicit model predictive control of fast dynamic system
Explicit model predictive control of fast dynamic systemExplicit model predictive control of fast dynamic system
Explicit model predictive control of fast dynamic systemeSAT Publishing House
 
Methodology for the Optimal Design of Metamorphic Manipulators - PhD Disserta...
Methodology for the Optimal Design of Metamorphic Manipulators - PhD Disserta...Methodology for the Optimal Design of Metamorphic Manipulators - PhD Disserta...
Methodology for the Optimal Design of Metamorphic Manipulators - PhD Disserta...Harry Valsamos
 
Exponential State Observer Design for a Class of Uncertain Chaotic and Non-Ch...
Exponential State Observer Design for a Class of Uncertain Chaotic and Non-Ch...Exponential State Observer Design for a Class of Uncertain Chaotic and Non-Ch...
Exponential State Observer Design for a Class of Uncertain Chaotic and Non-Ch...ijtsrd
 
Controllability of Linear Dynamical System
Controllability of  Linear Dynamical SystemControllability of  Linear Dynamical System
Controllability of Linear Dynamical SystemPurnima Pandit
 
Comparisons
ComparisonsComparisons
ComparisonsZifirio
 
Comparisons
ComparisonsComparisons
ComparisonsZifirio
 
Comparisons
ComparisonsComparisons
ComparisonsZifirio
 
Comparisons
ComparisonsComparisons
ComparisonsZifirio
 

Similaire à CS201- Introduction to Programming- Lecture 43 (20)

Chapter 3: Linear Systems and Matrices - Part 2/Slides
Chapter 3: Linear Systems and Matrices - Part 2/SlidesChapter 3: Linear Systems and Matrices - Part 2/Slides
Chapter 3: Linear Systems and Matrices - Part 2/Slides
 
Petri Nets: Properties, Analysis and Applications
Petri Nets: Properties, Analysis and ApplicationsPetri Nets: Properties, Analysis and Applications
Petri Nets: Properties, Analysis and Applications
 
Ebook mst209 block3_e1i1_n9780749252830_l1 (2)
Ebook mst209 block3_e1i1_n9780749252830_l1 (2)Ebook mst209 block3_e1i1_n9780749252830_l1 (2)
Ebook mst209 block3_e1i1_n9780749252830_l1 (2)
 
STate Space Analysis
STate Space AnalysisSTate Space Analysis
STate Space Analysis
 
Kaizen cso002 l1
Kaizen cso002 l1Kaizen cso002 l1
Kaizen cso002 l1
 
A Method for the Reduction 0f Linear High Order MIMO Systems Using Interlacin...
A Method for the Reduction 0f Linear High Order MIMO Systems Using Interlacin...A Method for the Reduction 0f Linear High Order MIMO Systems Using Interlacin...
A Method for the Reduction 0f Linear High Order MIMO Systems Using Interlacin...
 
03 programming 1
03 programming 103 programming 1
03 programming 1
 
A Parallel Direct Method For Solving Initial Value Problems For Ordinary Diff...
A Parallel Direct Method For Solving Initial Value Problems For Ordinary Diff...A Parallel Direct Method For Solving Initial Value Problems For Ordinary Diff...
A Parallel Direct Method For Solving Initial Value Problems For Ordinary Diff...
 
THE LEFT AND RIGHT BLOCK POLE PLACEMENT COMPARISON STUDY: APPLICATION TO FLIG...
THE LEFT AND RIGHT BLOCK POLE PLACEMENT COMPARISON STUDY: APPLICATION TO FLIG...THE LEFT AND RIGHT BLOCK POLE PLACEMENT COMPARISON STUDY: APPLICATION TO FLIG...
THE LEFT AND RIGHT BLOCK POLE PLACEMENT COMPARISON STUDY: APPLICATION TO FLIG...
 
THE LEFT AND RIGHT BLOCK POLE PLACEMENT COMPARISON STUDY: APPLICATION TO FLIG...
THE LEFT AND RIGHT BLOCK POLE PLACEMENT COMPARISON STUDY: APPLICATION TO FLIG...THE LEFT AND RIGHT BLOCK POLE PLACEMENT COMPARISON STUDY: APPLICATION TO FLIG...
THE LEFT AND RIGHT BLOCK POLE PLACEMENT COMPARISON STUDY: APPLICATION TO FLIG...
 
Explicit model predictive control of fast dynamic system
Explicit model predictive control of fast dynamic systemExplicit model predictive control of fast dynamic system
Explicit model predictive control of fast dynamic system
 
Explicit model predictive control of fast dynamic system
Explicit model predictive control of fast dynamic systemExplicit model predictive control of fast dynamic system
Explicit model predictive control of fast dynamic system
 
Methodology for the Optimal Design of Metamorphic Manipulators - PhD Disserta...
Methodology for the Optimal Design of Metamorphic Manipulators - PhD Disserta...Methodology for the Optimal Design of Metamorphic Manipulators - PhD Disserta...
Methodology for the Optimal Design of Metamorphic Manipulators - PhD Disserta...
 
Exponential State Observer Design for a Class of Uncertain Chaotic and Non-Ch...
Exponential State Observer Design for a Class of Uncertain Chaotic and Non-Ch...Exponential State Observer Design for a Class of Uncertain Chaotic and Non-Ch...
Exponential State Observer Design for a Class of Uncertain Chaotic and Non-Ch...
 
Controllability of Linear Dynamical System
Controllability of  Linear Dynamical SystemControllability of  Linear Dynamical System
Controllability of Linear Dynamical System
 
Queue
QueueQueue
Queue
 
Comparisons
ComparisonsComparisons
Comparisons
 
Comparisons
ComparisonsComparisons
Comparisons
 
Comparisons
ComparisonsComparisons
Comparisons
 
Comparisons
ComparisonsComparisons
Comparisons
 

Plus de Bilal Ahmed

CS201- Introduction to Programming- Lecture 42
CS201- Introduction to Programming- Lecture 42CS201- Introduction to Programming- Lecture 42
CS201- Introduction to Programming- Lecture 42Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 41
CS201- Introduction to Programming- Lecture 41CS201- Introduction to Programming- Lecture 41
CS201- Introduction to Programming- Lecture 41Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 40
CS201- Introduction to Programming- Lecture 40CS201- Introduction to Programming- Lecture 40
CS201- Introduction to Programming- Lecture 40Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 39
CS201- Introduction to Programming- Lecture 39CS201- Introduction to Programming- Lecture 39
CS201- Introduction to Programming- Lecture 39Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 38
CS201- Introduction to Programming- Lecture 38CS201- Introduction to Programming- Lecture 38
CS201- Introduction to Programming- Lecture 38Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 36
CS201- Introduction to Programming- Lecture 36CS201- Introduction to Programming- Lecture 36
CS201- Introduction to Programming- Lecture 36Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 34
CS201- Introduction to Programming- Lecture 34CS201- Introduction to Programming- Lecture 34
CS201- Introduction to Programming- Lecture 34Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 33
CS201- Introduction to Programming- Lecture 33CS201- Introduction to Programming- Lecture 33
CS201- Introduction to Programming- Lecture 33Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 32
CS201- Introduction to Programming- Lecture 32CS201- Introduction to Programming- Lecture 32
CS201- Introduction to Programming- Lecture 32Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 31
CS201- Introduction to Programming- Lecture 31CS201- Introduction to Programming- Lecture 31
CS201- Introduction to Programming- Lecture 31Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 30
CS201- Introduction to Programming- Lecture 30CS201- Introduction to Programming- Lecture 30
CS201- Introduction to Programming- Lecture 30Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 29
CS201- Introduction to Programming- Lecture 29CS201- Introduction to Programming- Lecture 29
CS201- Introduction to Programming- Lecture 29Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 28
CS201- Introduction to Programming- Lecture 28CS201- Introduction to Programming- Lecture 28
CS201- Introduction to Programming- Lecture 28Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 27
CS201- Introduction to Programming- Lecture 27CS201- Introduction to Programming- Lecture 27
CS201- Introduction to Programming- Lecture 27Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 24
CS201- Introduction to Programming- Lecture 24CS201- Introduction to Programming- Lecture 24
CS201- Introduction to Programming- Lecture 24Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 23
CS201- Introduction to Programming- Lecture 23CS201- Introduction to Programming- Lecture 23
CS201- Introduction to Programming- Lecture 23Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 22
CS201- Introduction to Programming- Lecture 22CS201- Introduction to Programming- Lecture 22
CS201- Introduction to Programming- Lecture 22Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 21
CS201- Introduction to Programming- Lecture 21CS201- Introduction to Programming- Lecture 21
CS201- Introduction to Programming- Lecture 21Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 20
CS201- Introduction to Programming- Lecture 20CS201- Introduction to Programming- Lecture 20
CS201- Introduction to Programming- Lecture 20Bilal Ahmed
 
CS201- Introduction to Programming- Lecture 19
CS201- Introduction to Programming- Lecture 19CS201- Introduction to Programming- Lecture 19
CS201- Introduction to Programming- Lecture 19Bilal Ahmed
 

Plus de Bilal Ahmed (20)

CS201- Introduction to Programming- Lecture 42
CS201- Introduction to Programming- Lecture 42CS201- Introduction to Programming- Lecture 42
CS201- Introduction to Programming- Lecture 42
 
CS201- Introduction to Programming- Lecture 41
CS201- Introduction to Programming- Lecture 41CS201- Introduction to Programming- Lecture 41
CS201- Introduction to Programming- Lecture 41
 
CS201- Introduction to Programming- Lecture 40
CS201- Introduction to Programming- Lecture 40CS201- Introduction to Programming- Lecture 40
CS201- Introduction to Programming- Lecture 40
 
CS201- Introduction to Programming- Lecture 39
CS201- Introduction to Programming- Lecture 39CS201- Introduction to Programming- Lecture 39
CS201- Introduction to Programming- Lecture 39
 
CS201- Introduction to Programming- Lecture 38
CS201- Introduction to Programming- Lecture 38CS201- Introduction to Programming- Lecture 38
CS201- Introduction to Programming- Lecture 38
 
CS201- Introduction to Programming- Lecture 36
CS201- Introduction to Programming- Lecture 36CS201- Introduction to Programming- Lecture 36
CS201- Introduction to Programming- Lecture 36
 
CS201- Introduction to Programming- Lecture 34
CS201- Introduction to Programming- Lecture 34CS201- Introduction to Programming- Lecture 34
CS201- Introduction to Programming- Lecture 34
 
CS201- Introduction to Programming- Lecture 33
CS201- Introduction to Programming- Lecture 33CS201- Introduction to Programming- Lecture 33
CS201- Introduction to Programming- Lecture 33
 
CS201- Introduction to Programming- Lecture 32
CS201- Introduction to Programming- Lecture 32CS201- Introduction to Programming- Lecture 32
CS201- Introduction to Programming- Lecture 32
 
CS201- Introduction to Programming- Lecture 31
CS201- Introduction to Programming- Lecture 31CS201- Introduction to Programming- Lecture 31
CS201- Introduction to Programming- Lecture 31
 
CS201- Introduction to Programming- Lecture 30
CS201- Introduction to Programming- Lecture 30CS201- Introduction to Programming- Lecture 30
CS201- Introduction to Programming- Lecture 30
 
CS201- Introduction to Programming- Lecture 29
CS201- Introduction to Programming- Lecture 29CS201- Introduction to Programming- Lecture 29
CS201- Introduction to Programming- Lecture 29
 
CS201- Introduction to Programming- Lecture 28
CS201- Introduction to Programming- Lecture 28CS201- Introduction to Programming- Lecture 28
CS201- Introduction to Programming- Lecture 28
 
CS201- Introduction to Programming- Lecture 27
CS201- Introduction to Programming- Lecture 27CS201- Introduction to Programming- Lecture 27
CS201- Introduction to Programming- Lecture 27
 
CS201- Introduction to Programming- Lecture 24
CS201- Introduction to Programming- Lecture 24CS201- Introduction to Programming- Lecture 24
CS201- Introduction to Programming- Lecture 24
 
CS201- Introduction to Programming- Lecture 23
CS201- Introduction to Programming- Lecture 23CS201- Introduction to Programming- Lecture 23
CS201- Introduction to Programming- Lecture 23
 
CS201- Introduction to Programming- Lecture 22
CS201- Introduction to Programming- Lecture 22CS201- Introduction to Programming- Lecture 22
CS201- Introduction to Programming- Lecture 22
 
CS201- Introduction to Programming- Lecture 21
CS201- Introduction to Programming- Lecture 21CS201- Introduction to Programming- Lecture 21
CS201- Introduction to Programming- Lecture 21
 
CS201- Introduction to Programming- Lecture 20
CS201- Introduction to Programming- Lecture 20CS201- Introduction to Programming- Lecture 20
CS201- Introduction to Programming- Lecture 20
 
CS201- Introduction to Programming- Lecture 19
CS201- Introduction to Programming- Lecture 19CS201- Introduction to Programming- Lecture 19
CS201- Introduction to Programming- Lecture 19
 

Dernier

MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6Vanessa Camilleri
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxAnupam32727
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfChristalin Nelson
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1GloryAnnCastre1
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research DiscourseAnita GoswamiGiri
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Developmentchesterberbo7
 
CHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxCHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxAneriPatwari
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 

Dernier (20)

MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdf
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research Discourse
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Development
 
CHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxCHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptx
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 

CS201- Introduction to Programming- Lecture 43

  • 2. Math Library  Complex number  Matrix  Quadratic equation and their solution …………….…
  • 3. DDeessiiggnn RReecciippee  TToo ddeessiiggnn aa pprrooggrraamm pprrooppeerrllyy,, wwee mmuusstt :: – AAnnaallyyzzee aa pprroobblleemm ssttaatteemmeenntt,, ttyyppiiccaallllyy eexxpprreesssseedd aass aa wwoorrdd pprroobblleemm – EExxpprreessss iittss eesssseennccee,, aabbssttrraaccttllyy aanndd wwiitthh eexxaammpplleess – FFoorrmmuullaattee ssttaatteemmeennttss aanndd ccoommmmeennttss iinn aa pprreecciissee llaanngguuaaggee ii..ee.. ccooddee – EEvvaalluuaattee aanndd rreevviissee tthhee aaccttiivviittiieess iinn lliigghhtt ooff cchheecckkss aanndd tteessttss aanndd – PPAAYY AATTTTEENNTTIIOONN TTOO DDEETTAAIILL
  • 4. Matrix • Matrix is nothing but a two dimensional array of numbers • Normally, represented in the form of : • Rows • Columns
  • 5. Example 1 2 3 4 5 6 7 8 9 10 11 12 A = Three Rows Four Columns
  • 6. i & j are two Integers i representing the Row number j representing the Column number
  • 7. Operations Performed with Matrix • Addition of two matrices. • Addition of a scalar and a matrix • Subtraction of two matrices • Subtraction of a scalar from a matrix • Multiplication of two matrices • Multiplication of a scalar with a matrix • Division of a scalar with a matrix • Transpose of a matrix
  • 9. Addition of two Matrices Aij+Bij = Cij
  • 10. Addition of two Matrices Size of two matrices must be same Number of rows and columns must be identical for the matrices to be addable
  • 11. Example 1 2 3 5 6 7 9 10 11 - 3 6 8 7 4 7 9 10 1 = -2 -4 -5 -2 2 0 0 0 10 Cij = Aij - Bij
  • 12. Adding a Scalar to the Matrix Ordinary number added to every element of the matrix
  • 13. Subtracting a Scalar from a Matrix Ordinary number subtracted from every element of the matrix
  • 14. Division of Matrix by a Scalar Divide every element of Matrix by a scalar number
  • 15. Example Let : X be a Scalar number A be a Matrix C = Aij ij X
  • 16. Multiplication of a scalar with a Matrix Example Let : X is a Scalar number A is a Matrix X * A X * Aij = Cij
  • 17. Multiply two Matrices 1 2 * 2 4 5 6 1 2 = ( 1 ) ( 2 ) + ( 2 ) ( 1 ) ( 1 ) ( 4 ) + ( 2 ) ( 2 ) ( 5 ) ( 2 ) + ( 6 ) ( 1 ) ( 5 ) ( 4 ) + ( 6 ) ( 2 )
  • 18. Rules Regarding Matrix Multiplication Number of columns of the 1st Matrix = Number of rows of the 2nd Matrix
  • 19. Rules rreeggaarrddiinngg MMaattrriixx MMuullttiipplliiccaattiioonn  FFiirrsstt mmaattrriixx hhaass – MM rroowwss – NN ccoolluummnnss  SSeeccoonndd mmaattrriixx hhaass – NN rroowwss – PP ccoolluummnnss  RReessuullttaanntt mmaattrriixx wwiillll hhaavvee – MM rroowwss – PP ccoolluummnnss
  • 20. Transpose of a Matrix Interchange of rows and columns
  • 21. Transpose of a Matrix Example 1 2 3 5 6 7 9 10 11 1 5 9 2 6 10 3 7 11
  • 22. Transpose of a Non Square Matrix Size of matrix change after transpose A AT 3 ( Rows ) * 4 ( Columns ) Before 4 ( Rows ) * 3 ( Columns ) After
  • 23. Next Phase of Analysis • Determine the Constants • Memory Allocation • What is it’s user interface
  • 25. IInntteerrffaaccee CCoonnssttrruuccttoorr :: PPaarraammeetteerrss aarree NNuummbbeerr ooff rroowwss NNuummbbeerr ooff ccoolluummnnss DDiissppllaayy ffuunnccttiioonn PPlluuss ooppeerraattoorr :: mmeemmbbeerr ooppeerraattoorr ooff tthhee ccllaassss SSuubbttrraaccttiioonn ooppeerraattoorr :: mmeemmbbeerr ooppeerraattoorr ooff tthhee ccllaassss PPlluuss ooppeerraattoorr :: ffrriieenndd ooff tthhee ccllaassss SSuubbttrraaccttiioonn ooppeerraattoorr :: ffrriieenndd ooff tthhee ccllaassss
  • 26. Plus Operator A + X X + A
  • 27. Subtraction Operator A - X X – A
  • 28. *
  • 29. IInntteerrffaaccee MMuullttiipplliiccaattiioonn OOppeerraattoorr :: MMeemmbbeerr ooff tthhee CCllaassss MMuullttiipplliiccaattiioonn OOppeerraattoorr :: FFrriieenndd ooff tthhee CCllaassss DDiivviissiioonn OOppeerraattoorr :: MMeemmbbeerr ooff tthhee CCllaassss TTrraannssppoossee FFuunnccttiioonn :: MMeemmbbeerr ooff tthhee CCllaassss AAssssiiggnnmmeenntt OOppeerraattoorr :: MMeemmbbeerr ooff tthhee CCllaassss ++== ,, --== :: MMeemmbbeerrss ooff tthhee CCllaassss
  • 31. Assignment Operator A = B ( Member Operator )
  • 32. Interface >> Extraction Operator : Friend Operator << Stream Insertion Operator : Friend Operator
  • 34.  CCooppyy CCoonnssttrruuccttoorr  AAssssiiggnnmmeenntt OOppeerraattoorr  MMeemmoorryy AAllllooccaattiioonn  MMeemmoorryy DDeeaallllooccaattiioonn