SlideShare a Scribd company logo
1 of 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

More Related Content

Viewers also liked

Viewers also liked (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
 

Similar to CS201- Introduction to Programming- Lecture 43

Kaizen cso002 l1
Kaizen cso002 l1Kaizen cso002 l1
Kaizen cso002 l1
asslang
 
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
 
Comparisons
ComparisonsComparisons
Comparisons
Zifirio
 
Comparisons
ComparisonsComparisons
Comparisons
Zifirio
 
Comparisons
ComparisonsComparisons
Comparisons
Zifirio
 
Comparisons
ComparisonsComparisons
Comparisons
Zifirio
 

Similar to 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
 

More from Bilal Ahmed

More from 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
 

Recently uploaded

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Recently uploaded (20)

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 

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