SlideShare a Scribd company logo
Programming Fundamentals
Consider this Example ,[object Object],Programming Fundamentals | Lecture-8
Programming Fundamentals | Lecture-8 START STOP sum = 0 sum = sum + 2 sum = sum + 3 sum = sum + 4 sum = sum + 5 DISPLAY sum (sum=1) (sum=3) (sum=6) (sum=10) (sum=15) sum = sum + 1 (sum=0)
Consider This ,[object Object],[object Object],Programming Fundamentals | Lecture-8
Programming Fundamentals | Lecture-8 What if the numbers are not just 50, they are 1000?
Analyze the Problem ,[object Object],[object Object],[object Object],Programming Fundamentals | Lecture-8
Is this Correct? Programming Fundamentals | Lecture-8 START sum = 0 sum = sum + _ STOP
What is Required? ,[object Object],[object Object],[object Object],[object Object],Programming Fundamentals | Lecture-8
How to Achieve This? ,[object Object],[object Object],[object Object],[object Object],Programming Fundamentals | Lecture-8
Sum of 1 st  5 natural numbers Programming Fundamentals | Lecture-8 START sum = 0 count = count + 1 STOP count < 5 count = 0 DISPLAY sum Yes No sum = sum + count
How to Test This? Programming Fundamentals | Lecture-8 count = 0 sum = 0 Repetition-1 Repetition-2 Repetition-3 Repetition-4 Repetition-5 decision (count < 5) 0 < 5 1 < 5 2 < 5 3 < 5 4 < 5 count  =  count  + 1 1 2 3 4 5 sum  =  sum  +  count 1 3 6 10 15
Power of Computer Programs ,[object Object],[object Object],[object Object],[object Object],Programming Fundamentals | Lecture-8
Steps to Follow ,[object Object],[object Object],Programming Fundamentals | Lecture-8
Extending that Example ,[object Object],[object Object],Programming Fundamentals | Lecture-8
Programming Fundamentals | Lecture-8 START sum = 0 count = count + 1 STOP count < n count = 0 DISPLAY sum Yes No sum = sum + count READ n
Another Example ,[object Object],[object Object],Programming Fundamentals | Lecture-8
Programming Fundamentals | Lecture-8 START fact = 1 count = count + 1 STOP count < n count = 0 DISPLAY sum Yes No fact = fact * count  READ n
Testing Programming Fundamentals | Lecture-8 count = 0 fact = 1 n = 5 120 = 24 * 5 5 = 4 + 1 4 < 5 Repetition-5 Repetition-1 Repetition-2 Repetition-3 Repetition-4 decision (count < 5) 0 < 5 1 < 5 2 < 5 3 < 5 count  =  count  + 1 1 = 0 + 1 2 = 1 + 1 3 = 2 + 1 4 = 3 + 1 fact  =  fact *  count 1 = 1 * 1 2 = 2 *1 6 = 2 * 3 24 = 6 * 4
Try this Yourself ,[object Object],[object Object],[object Object],[object Object],[object Object],Programming Fundamentals | Lecture-8
Tasks  (to be done by next lecture) ,[object Object],[object Object],[object Object]
Programming Fundamentals | Lecture-8 BE PREPARED FOR  QUIZ IN NEXT LECTURE

More Related Content

What's hot

parallelizing Trapezoidal rule
parallelizing Trapezoidal rule parallelizing Trapezoidal rule
parallelizing Trapezoidal rule
zainab mohammed
 
Model and Design
Model and Design Model and Design
Model and Design
Dr Shashikant Athawale
 
Introduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of OptimalityIntroduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of Optimality
Bhavin Darji
 
Dynamic programming 2
Dynamic programming 2Dynamic programming 2
Dynamic programming 2Roy Thomas
 
Exam100118
Exam100118Exam100118
Exam100118
Sou Tibon
 
Exam100412
Exam100412Exam100412
Exam100412
Sou Tibon
 
Computer programming
Computer programmingComputer programming
Computer programming
Matanga Eunyo
 
Greedy method
Greedy methodGreedy method
Greedy method
Anusha sivakumar
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
Yıldırım Tam
 
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...
Simplilearn
 
Introduction to programming
Introduction  to programmingIntroduction  to programming
Introduction to programming
Suchat Bon
 
جلسه اول الگوریتم و فلوچارت
جلسه اول الگوریتم و فلوچارتجلسه اول الگوریتم و فلوچارت
جلسه اول الگوریتم و فلوچارت
Hamid Jahangiri
 
Introduction to dynamic programming
Introduction to dynamic programmingIntroduction to dynamic programming
Introduction to dynamic programming
Amisha Narsingani
 

What's hot (15)

parallelizing Trapezoidal rule
parallelizing Trapezoidal rule parallelizing Trapezoidal rule
parallelizing Trapezoidal rule
 
Model and Design
Model and Design Model and Design
Model and Design
 
Exp 1
Exp 1Exp 1
Exp 1
 
Introduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of OptimalityIntroduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of Optimality
 
Dynamic programming 2
Dynamic programming 2Dynamic programming 2
Dynamic programming 2
 
Exam100118
Exam100118Exam100118
Exam100118
 
Dynamicpgmming
DynamicpgmmingDynamicpgmming
Dynamicpgmming
 
Exam100412
Exam100412Exam100412
Exam100412
 
Computer programming
Computer programmingComputer programming
Computer programming
 
Greedy method
Greedy methodGreedy method
Greedy method
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
 
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...
What Is Dynamic Programming? | Dynamic Programming Explained | Programming Fo...
 
Introduction to programming
Introduction  to programmingIntroduction  to programming
Introduction to programming
 
جلسه اول الگوریتم و فلوچارت
جلسه اول الگوریتم و فلوچارتجلسه اول الگوریتم و فلوچارت
جلسه اول الگوریتم و فلوچارت
 
Introduction to dynamic programming
Introduction to dynamic programmingIntroduction to dynamic programming
Introduction to dynamic programming
 

Viewers also liked

Fundamentals of programming angeli
Fundamentals of programming angeliFundamentals of programming angeli
Fundamentals of programming angeli
bergonio11339481
 
Programming Fundamental Slide No.1
Programming Fundamental Slide No.1Programming Fundamental Slide No.1
Programming Fundamental Slide No.1
Arslan Hussain
 
Introduction of Functional Programming
Introduction of Functional ProgrammingIntroduction of Functional Programming
Introduction of Functional Programming
☁️ Mikhail Shilkov
 
Programming fundamentals lecture 1 0f c
Programming fundamentals lecture 1 0f cProgramming fundamentals lecture 1 0f c
Programming fundamentals lecture 1 0f cRaja Hamid
 
Programming Fundamental Presentation
Programming Fundamental PresentationProgramming Fundamental Presentation
Programming Fundamental Presentation
fazli khaliq
 
Intro to functional programming
Intro to functional programmingIntro to functional programming
Intro to functional programming
Assaf Gannon
 
Fundamental Programming Lect 2
Fundamental Programming Lect 2Fundamental Programming Lect 2
Fundamental Programming Lect 2
Namrah Erum
 
Fundamental Programming Lect 3
Fundamental Programming Lect 3Fundamental Programming Lect 3
Fundamental Programming Lect 3
Namrah Erum
 
Programming fundamentals lecture 1&2
Programming fundamentals lecture 1&2Programming fundamentals lecture 1&2
Programming fundamentals lecture 1&2Raja Hamid
 
Fundamental Programming Lect 1
Fundamental Programming Lect 1Fundamental Programming Lect 1
Fundamental Programming Lect 1
Namrah Erum
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
Trivuz ত্রিভুজ
 
Programing Fundamental
Programing FundamentalPrograming Fundamental
Programing Fundamental
Qazi Shahzad Ali
 
Functional Programming Fundamentals
Functional Programming FundamentalsFunctional Programming Fundamentals
Functional Programming Fundamentals
Shahriar Hyder
 

Viewers also liked (13)

Fundamentals of programming angeli
Fundamentals of programming angeliFundamentals of programming angeli
Fundamentals of programming angeli
 
Programming Fundamental Slide No.1
Programming Fundamental Slide No.1Programming Fundamental Slide No.1
Programming Fundamental Slide No.1
 
Introduction of Functional Programming
Introduction of Functional ProgrammingIntroduction of Functional Programming
Introduction of Functional Programming
 
Programming fundamentals lecture 1 0f c
Programming fundamentals lecture 1 0f cProgramming fundamentals lecture 1 0f c
Programming fundamentals lecture 1 0f c
 
Programming Fundamental Presentation
Programming Fundamental PresentationProgramming Fundamental Presentation
Programming Fundamental Presentation
 
Intro to functional programming
Intro to functional programmingIntro to functional programming
Intro to functional programming
 
Fundamental Programming Lect 2
Fundamental Programming Lect 2Fundamental Programming Lect 2
Fundamental Programming Lect 2
 
Fundamental Programming Lect 3
Fundamental Programming Lect 3Fundamental Programming Lect 3
Fundamental Programming Lect 3
 
Programming fundamentals lecture 1&2
Programming fundamentals lecture 1&2Programming fundamentals lecture 1&2
Programming fundamentals lecture 1&2
 
Fundamental Programming Lect 1
Fundamental Programming Lect 1Fundamental Programming Lect 1
Fundamental Programming Lect 1
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
 
Programing Fundamental
Programing FundamentalPrograming Fundamental
Programing Fundamental
 
Functional Programming Fundamentals
Functional Programming FundamentalsFunctional Programming Fundamentals
Functional Programming Fundamentals
 

Similar to Cs 1114 - lecture-8

Cs 1114 - lecture-10
Cs 1114 - lecture-10Cs 1114 - lecture-10
Cs 1114 - lecture-10Zeeshan Sabir
 
Python Control structures
Python Control structuresPython Control structures
Python Control structures
Siddique Ibrahim
 
The secret of Functional Programming revealed!
The secret of Functional Programming revealed!The secret of Functional Programming revealed!
The secret of Functional Programming revealed!
Torbjørn Marø
 
Python Homework Help
Python Homework HelpPython Homework Help
Python Homework Help
Python Homework Help
 
Course project solutions 2018
Course project solutions 2018Course project solutions 2018
Course project solutions 2018
Robert Geofroy
 
Course project solutions 2019
Course project solutions 2019Course project solutions 2019
Course project solutions 2019
Robert Geofroy
 
Logika dan Algoritma pemrograman
Logika dan Algoritma pemrogramanLogika dan Algoritma pemrograman
Logika dan Algoritma pemrograman
Arif Huda
 
02 Control Structures - Loops & Conditions
02 Control Structures - Loops & Conditions02 Control Structures - Loops & Conditions
02 Control Structures - Loops & Conditions
Ebad ullah Qureshi
 
Data structures Lecture no. 4
Data structures Lecture no. 4Data structures Lecture no. 4
Data structures Lecture no. 4
AzharIqbal710687
 
Functional pogramming hl overview
Functional pogramming hl overviewFunctional pogramming hl overview
Functional pogramming hl overview
Elad Avneri
 
The Final Programming Project
The Final Programming ProjectThe Final Programming Project
The Final Programming ProjectSage Jacobs
 
01 Programming Fundamentals.pptx
01 Programming Fundamentals.pptx01 Programming Fundamentals.pptx
01 Programming Fundamentals.pptx
JustineLincopinesAlm
 
2-Algorithms and Complexit data structurey.pdf
2-Algorithms and Complexit data structurey.pdf2-Algorithms and Complexit data structurey.pdf
2-Algorithms and Complexit data structurey.pdf
ishan743441
 
Introduction to-programming
Introduction to-programmingIntroduction to-programming
Introduction to-programming
pakhpoom00110
 
Operations of Integers.pptx
Operations of Integers.pptxOperations of Integers.pptx
Operations of Integers.pptx
anndumadag
 
Introduction to basic programming repetition
Introduction to basic programming repetitionIntroduction to basic programming repetition
Introduction to basic programming repetition
Jordan Delacruz
 

Similar to Cs 1114 - lecture-8 (20)

Cs 1114 - lecture-9
Cs 1114 - lecture-9Cs 1114 - lecture-9
Cs 1114 - lecture-9
 
Cs 1114 - lecture-10
Cs 1114 - lecture-10Cs 1114 - lecture-10
Cs 1114 - lecture-10
 
Cs 1114 - lecture-3
Cs 1114 - lecture-3Cs 1114 - lecture-3
Cs 1114 - lecture-3
 
Python Control structures
Python Control structuresPython Control structures
Python Control structures
 
The secret of Functional Programming revealed!
The secret of Functional Programming revealed!The secret of Functional Programming revealed!
The secret of Functional Programming revealed!
 
Python Homework Help
Python Homework HelpPython Homework Help
Python Homework Help
 
Course project solutions 2018
Course project solutions 2018Course project solutions 2018
Course project solutions 2018
 
Course project solutions 2019
Course project solutions 2019Course project solutions 2019
Course project solutions 2019
 
Logika dan Algoritma pemrograman
Logika dan Algoritma pemrogramanLogika dan Algoritma pemrograman
Logika dan Algoritma pemrograman
 
02 Control Structures - Loops & Conditions
02 Control Structures - Loops & Conditions02 Control Structures - Loops & Conditions
02 Control Structures - Loops & Conditions
 
Data structures Lecture no. 4
Data structures Lecture no. 4Data structures Lecture no. 4
Data structures Lecture no. 4
 
Algorithms with-java-1.0
Algorithms with-java-1.0Algorithms with-java-1.0
Algorithms with-java-1.0
 
Functional pogramming hl overview
Functional pogramming hl overviewFunctional pogramming hl overview
Functional pogramming hl overview
 
Cs 1114 - lecture-5
Cs 1114 - lecture-5Cs 1114 - lecture-5
Cs 1114 - lecture-5
 
The Final Programming Project
The Final Programming ProjectThe Final Programming Project
The Final Programming Project
 
01 Programming Fundamentals.pptx
01 Programming Fundamentals.pptx01 Programming Fundamentals.pptx
01 Programming Fundamentals.pptx
 
2-Algorithms and Complexit data structurey.pdf
2-Algorithms and Complexit data structurey.pdf2-Algorithms and Complexit data structurey.pdf
2-Algorithms and Complexit data structurey.pdf
 
Introduction to-programming
Introduction to-programmingIntroduction to-programming
Introduction to-programming
 
Operations of Integers.pptx
Operations of Integers.pptxOperations of Integers.pptx
Operations of Integers.pptx
 
Introduction to basic programming repetition
Introduction to basic programming repetitionIntroduction to basic programming repetition
Introduction to basic programming repetition
 

More from Zeeshan Sabir

Cs 1114 - lecture-29
Cs 1114 - lecture-29Cs 1114 - lecture-29
Cs 1114 - lecture-29Zeeshan Sabir
 
Final logic presentation
Final logic presentationFinal logic presentation
Final logic presentation
Zeeshan Sabir
 
Human resource management process
Human resource management processHuman resource management process
Human resource management processZeeshan Sabir
 

More from Zeeshan Sabir (8)

Cs 1114 - lecture-7
Cs 1114 - lecture-7Cs 1114 - lecture-7
Cs 1114 - lecture-7
 
Cs 1114 - lecture-6
Cs 1114 - lecture-6Cs 1114 - lecture-6
Cs 1114 - lecture-6
 
Cs 1114 - lecture-4
Cs 1114 - lecture-4Cs 1114 - lecture-4
Cs 1114 - lecture-4
 
Cs 1114 - lecture-2
Cs 1114 - lecture-2Cs 1114 - lecture-2
Cs 1114 - lecture-2
 
Cs 1114 - lecture-1
Cs 1114 - lecture-1Cs 1114 - lecture-1
Cs 1114 - lecture-1
 
Cs 1114 - lecture-29
Cs 1114 - lecture-29Cs 1114 - lecture-29
Cs 1114 - lecture-29
 
Final logic presentation
Final logic presentationFinal logic presentation
Final logic presentation
 
Human resource management process
Human resource management processHuman resource management process
Human resource management process
 

Recently uploaded

Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 

Recently uploaded (20)

Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 

Cs 1114 - lecture-8

  • 2.
  • 3. Programming Fundamentals | Lecture-8 START STOP sum = 0 sum = sum + 2 sum = sum + 3 sum = sum + 4 sum = sum + 5 DISPLAY sum (sum=1) (sum=3) (sum=6) (sum=10) (sum=15) sum = sum + 1 (sum=0)
  • 4.
  • 5. Programming Fundamentals | Lecture-8 What if the numbers are not just 50, they are 1000?
  • 6.
  • 7. Is this Correct? Programming Fundamentals | Lecture-8 START sum = 0 sum = sum + _ STOP
  • 8.
  • 9.
  • 10. Sum of 1 st 5 natural numbers Programming Fundamentals | Lecture-8 START sum = 0 count = count + 1 STOP count < 5 count = 0 DISPLAY sum Yes No sum = sum + count
  • 11. How to Test This? Programming Fundamentals | Lecture-8 count = 0 sum = 0 Repetition-1 Repetition-2 Repetition-3 Repetition-4 Repetition-5 decision (count < 5) 0 < 5 1 < 5 2 < 5 3 < 5 4 < 5 count = count + 1 1 2 3 4 5 sum = sum + count 1 3 6 10 15
  • 12.
  • 13.
  • 14.
  • 15. Programming Fundamentals | Lecture-8 START sum = 0 count = count + 1 STOP count < n count = 0 DISPLAY sum Yes No sum = sum + count READ n
  • 16.
  • 17. Programming Fundamentals | Lecture-8 START fact = 1 count = count + 1 STOP count < n count = 0 DISPLAY sum Yes No fact = fact * count READ n
  • 18. Testing Programming Fundamentals | Lecture-8 count = 0 fact = 1 n = 5 120 = 24 * 5 5 = 4 + 1 4 < 5 Repetition-5 Repetition-1 Repetition-2 Repetition-3 Repetition-4 decision (count < 5) 0 < 5 1 < 5 2 < 5 3 < 5 count = count + 1 1 = 0 + 1 2 = 1 + 1 3 = 2 + 1 4 = 3 + 1 fact = fact * count 1 = 1 * 1 2 = 2 *1 6 = 2 * 3 24 = 6 * 4
  • 19.
  • 20.
  • 21. Programming Fundamentals | Lecture-8 BE PREPARED FOR QUIZ IN NEXT LECTURE

Editor's Notes

  1. * Only a decision box can divide the order or flow of program into two alternative paths