SlideShare une entreprise Scribd logo
1  sur  22
Programming Fundamentals
Tasks  (from previous lecture) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Programming Fundamentals | Lecture-3
Power of Computer Programs ,[object Object],[object Object],[object Object],Programming Fundamentals | Lecture-3 Now We Will Further Explore Their Power
Consider this Problem ,[object Object],[object Object],Programming Fundamentals | Lecture-3
Difference of Two numbers Programming Fundamentals | Lecture-3 START READ number1, number2 difference = number1 - number2 DISPLAY difference STOP Will result in a negative value if number1 is smaller than number2
Is This Solution Correct? Programming Fundamentals | Lecture-3 START READ number1, number2 difference = number1 - number2 DISPLAY difference STOP difference = difference * -1
Analyze the Problem ,[object Object],[object Object],[object Object],[object Object],[object Object],Programming Fundamentals | Lecture-3
What is to be Done? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Programming Fundamentals | Lecture-3
Should we design  two different solutions? Programming Fundamentals | Lecture-1
What is Required? ,[object Object],[object Object],Programming Fundamentals | Lecture-3
Decision Box Programming Fundamentals | Lecture-3 Decision Rule Yes No Always in the form whose answer is  “ Yes” or “No”
Programming Fundamentals | Lecture-3 START READ number1, number2 difference = number1 - number2 DISPLAY difference STOP difference = difference * -1 difference < 0 Yes No
Power of Computers ,[object Object],[object Object],[object Object],[object Object],Programming Fundamentals | Lecture-3
Another Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Programming Fundamentals | Lecture-3
Programming Fundamentals | Lecture-3 START READ number1, number2 DISPLAY smaller STOP smaller = number1 number1 < number2 Yes No smaller = number2
Alternative Programming Fundamentals | Lecture-3 START READ number1, number2 STOP DISPLAY number1 number1 < number2 Yes No DISPLAY number2
Comparison Operators ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Programming Fundamentals | Lecture-3
Output a Message Programming Fundamentals | Lecture-3 DISPLAY “This is a message”
Try it Yourself ,[object Object],[object Object],[object Object],Programming Fundamentals | Lecture-3
Some Keywords ,[object Object],[object Object],[object Object],[object Object],Programming Fundamentals | Lecture-3
Tasks  (to be done by next lecture) ,[object Object],[object Object],[object Object],[object Object],[object Object],Programming Fundamentals | Lecture-3
Programming Fundamentals | Lecture-2 BE PREPARED FOR  QUIZ  IN  NEXT LECTURE

Contenu connexe

Tendances

Inequalities ppt revised
Inequalities ppt revisedInequalities ppt revised
Inequalities ppt revised
troxellm
 
01_Probability of Simple Events.ppt
01_Probability of Simple Events.ppt01_Probability of Simple Events.ppt
01_Probability of Simple Events.ppt
ReinabelleMarquez1
 

Tendances (7)

Addition and subtraction
Addition and subtractionAddition and subtraction
Addition and subtraction
 
Inequalities ppt revised
Inequalities ppt revisedInequalities ppt revised
Inequalities ppt revised
 
Bresenham Line Drawing Algorithm
Bresenham Line Drawing AlgorithmBresenham Line Drawing Algorithm
Bresenham Line Drawing Algorithm
 
Geometric sequences and series
Geometric sequences and seriesGeometric sequences and series
Geometric sequences and series
 
Division
DivisionDivision
Division
 
01_Probability of Simple Events.ppt
01_Probability of Simple Events.ppt01_Probability of Simple Events.ppt
01_Probability of Simple Events.ppt
 
Prime numbers
Prime numbersPrime numbers
Prime numbers
 

Similaire à Cs 1114 - lecture-3

Cs 1114 - lecture-10
Cs 1114 - lecture-10Cs 1114 - lecture-10
Cs 1114 - lecture-10
Zeeshan Sabir
 
Covidien Dc Work Keys 101 2
Covidien Dc    Work Keys 101 2Covidien Dc    Work Keys 101 2
Covidien Dc Work Keys 101 2
LauraAtACT
 
Introduction to Programming
Introduction to ProgrammingIntroduction to Programming
Introduction to Programming
ALI RAZA
 
How to add and multiply fractions
How to add and multiply fractionsHow to add and multiply fractions
How to add and multiply fractions
brandi28216
 
ICT_Seminar_flow_charts_for_2013_Nov.pptx
ICT_Seminar_flow_charts_for_2013_Nov.pptxICT_Seminar_flow_charts_for_2013_Nov.pptx
ICT_Seminar_flow_charts_for_2013_Nov.pptx
ssuser2f67c91
 
Saxman Hypermedia
Saxman HypermediaSaxman Hypermedia
Saxman Hypermedia
sdsaxman
 

Similaire à Cs 1114 - lecture-3 (20)

Fundamental Programming Lect 3
Fundamental Programming Lect 3Fundamental Programming Lect 3
Fundamental Programming Lect 3
 
Cs 1114 - lecture-10
Cs 1114 - lecture-10Cs 1114 - lecture-10
Cs 1114 - lecture-10
 
Cs 1114 - lecture-4
Cs 1114 - lecture-4Cs 1114 - lecture-4
Cs 1114 - lecture-4
 
Fundamental Programming Lect 4
Fundamental Programming Lect 4Fundamental Programming Lect 4
Fundamental Programming Lect 4
 
Cs 1114 - lecture-5
Cs 1114 - lecture-5Cs 1114 - lecture-5
Cs 1114 - lecture-5
 
Fundamental Programming Lect 5
Fundamental Programming Lect 5Fundamental Programming Lect 5
Fundamental Programming Lect 5
 
Cs 1114 - lecture-2
Cs 1114 - lecture-2Cs 1114 - lecture-2
Cs 1114 - lecture-2
 
Cs 1114 - lecture-8
Cs 1114 - lecture-8Cs 1114 - lecture-8
Cs 1114 - lecture-8
 
Cs 1114 - lecture-7
Cs 1114 - lecture-7Cs 1114 - lecture-7
Cs 1114 - lecture-7
 
Covidien Dc Work Keys 101 2
Covidien Dc    Work Keys 101 2Covidien Dc    Work Keys 101 2
Covidien Dc Work Keys 101 2
 
Std 10 computer chapter 9 Problems and Problem Solving
Std 10 computer chapter 9 Problems and Problem SolvingStd 10 computer chapter 9 Problems and Problem Solving
Std 10 computer chapter 9 Problems and Problem Solving
 
Cs 1114 - lecture-9
Cs 1114 - lecture-9Cs 1114 - lecture-9
Cs 1114 - lecture-9
 
Introduction to Programming
Introduction to ProgrammingIntroduction to Programming
Introduction to Programming
 
Fundamental Programming Lect 2
Fundamental Programming Lect 2Fundamental Programming Lect 2
Fundamental Programming Lect 2
 
problem solving and design By ZAK
problem solving and design By ZAKproblem solving and design By ZAK
problem solving and design By ZAK
 
How to add and multiply fractions
How to add and multiply fractionsHow to add and multiply fractions
How to add and multiply fractions
 
ICT_Seminar_flow_charts_for_2013_Nov.pptx
ICT_Seminar_flow_charts_for_2013_Nov.pptxICT_Seminar_flow_charts_for_2013_Nov.pptx
ICT_Seminar_flow_charts_for_2013_Nov.pptx
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Saxman Hypermedia
Saxman HypermediaSaxman Hypermedia
Saxman Hypermedia
 
CC-112-Lec.1.ppsx
CC-112-Lec.1.ppsxCC-112-Lec.1.ppsx
CC-112-Lec.1.ppsx
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 

Cs 1114 - lecture-3

  • 2.
  • 3.
  • 4.
  • 5. Difference of Two numbers Programming Fundamentals | Lecture-3 START READ number1, number2 difference = number1 - number2 DISPLAY difference STOP Will result in a negative value if number1 is smaller than number2
  • 6. Is This Solution Correct? Programming Fundamentals | Lecture-3 START READ number1, number2 difference = number1 - number2 DISPLAY difference STOP difference = difference * -1
  • 7.
  • 8.
  • 9. Should we design two different solutions? Programming Fundamentals | Lecture-1
  • 10.
  • 11. Decision Box Programming Fundamentals | Lecture-3 Decision Rule Yes No Always in the form whose answer is “ Yes” or “No”
  • 12. Programming Fundamentals | Lecture-3 START READ number1, number2 difference = number1 - number2 DISPLAY difference STOP difference = difference * -1 difference < 0 Yes No
  • 13.
  • 14.
  • 15. Programming Fundamentals | Lecture-3 START READ number1, number2 DISPLAY smaller STOP smaller = number1 number1 < number2 Yes No smaller = number2
  • 16. Alternative Programming Fundamentals | Lecture-3 START READ number1, number2 STOP DISPLAY number1 number1 < number2 Yes No DISPLAY number2
  • 17.
  • 18. Output a Message Programming Fundamentals | Lecture-3 DISPLAY “This is a message”
  • 19.
  • 20.
  • 21.
  • 22. Programming Fundamentals | Lecture-2 BE PREPARED FOR QUIZ IN NEXT LECTURE