SlideShare a Scribd company logo
Programming Fundamentals
Recap of Previous Lectures To solve a problem using computers, we need to do the following: Define the problem (in terms of inputs, outputs and processing) Design a solution for it (using a graphical approach) Symbols used Oval – Start and Stop Parallelogram – Input and Output Rectangle - Processing Diamond -  Decision box Programming Fundamentals | Lecture-4
Recap of Previous Lectures Problems we looked at Sum, Product, Difference of two numbers Square or cube of a number Solving an equation or a formula involving 3, 4 variables Example Some formulae from elementary physics or an algebraic equation Programming Fundamentals | Lecture-4
Recap of Previous Lectures Decision making is required in many real-world problems Computer programs can be very useful in this regard To incorporate decision making in our solutions we learnt the usage of “Decision box” Programming Fundamentals | Lecture-4 Decision Rule Yes No Always in the form whose answer is  “ Yes” or “No”
Recap of Previous Lectures We always make comparisons in a decision box or Decision Rules are always in the form of comparisons Examples difference < 0 sum > 0 number2 != 0 marks >= 50 Programming Fundamentals | Lecture-4
Recap of Previous Lectures To determine the usage of decision rule, follow these steps Define inputs and outputs Is decision-making required in this solution? What are the basis of decision? the thing which is required to make a decision will appear in the decision box What kind of comparison is required in the decision box? Programming Fundamentals | Lecture-4
Recap of Previous Lectures Problems we looked at Checking negativity of a number Checking equality of two numbers Multiplying or Dividing two numbers conditionally Checking status of a student Programming Fundamentals | Lecture-4
Tasks  (from previous lecture) Find  whether  the sum of two numbers is greater than 50 Find  whether  the sum of two numbers is greater than the third number? Divide a number by another  if only if  the second number is not equal to “0” Determine  whether  a student is “passed” or “failed” from his marks A student securing marks less than 50 is considered “failed” Programming Fundamentals | Lecture-4
Decision Rules So far 1 decision rule in a decision box Examples difference < 0 number2 != 0 marks < 50 Programming Fundamentals | Lecture-4 difference < 0 number2 != 0 marks< 50
Consider This Example Divide a number by another  if  the second number is greater than “0” and less than “10” Divide a number by another  if  the second number is between “0” and “10” (also known as range check) Programming Fundamentals | Lecture-4 OR
Programming Fundamentals | Lecture-4 START READ num1, num2 DISPLAY answer STOP answer = num1 / num2 num2 > 0 Yes No
More than 1 Decision Rule Programming Fundamentals | Lecture-4 START READ num1, num2 DISPLAY answer STOP answer = num1 / num2 num2 > 0 AND num2 < 10 Yes No
Another Example Add two numbers if either of them is “0” Programming Fundamentals | Lecture-4
Another Example Determine status of a Students from marks of two of his subjects If marks for both the subjects are greater than 40 he’s considered passed Programming Fundamentals | Lecture-4
Another Example Determine status of a Students from marks of two of his subjects If marks for any of the subjects is greater than 40 he’s considered passed Programming Fundamentals | Lecture-4
Programming Fundamentals | Lecture-4 BE PREPARED FOR  ON-THE-SPOT TEST IN NEXT LECTURE

More Related Content

PPT
Fundamental Programming Lect 4
PPT
Fundamental Programming Lect 5
PPTX
Logical Reasoning Test tutorial_sample for slideshare
PDF
Lesson 11 1
PPTX
About the ap calculus exam - 2013
PPTX
What should i assess on the test
PPT
What should i assess on the test
PPTX
Week4 practice
Fundamental Programming Lect 4
Fundamental Programming Lect 5
Logical Reasoning Test tutorial_sample for slideshare
Lesson 11 1
About the ap calculus exam - 2013
What should i assess on the test
What should i assess on the test
Week4 practice

What's hot (6)

DOC
Viva dc transient
PPTX
Sat act overview
PPTX
Blue print
PDF
1 introduction to problem solving and programming
PPT
Design Test Case Technique (Equivalence partitioning And Boundary value analy...
PPTX
How to Pass Non-Verbal Reasoning Tests: 11+ and Job Assessments - Golden Nuggets
Viva dc transient
Sat act overview
Blue print
1 introduction to problem solving and programming
Design Test Case Technique (Equivalence partitioning And Boundary value analy...
How to Pass Non-Verbal Reasoning Tests: 11+ and Job Assessments - Golden Nuggets
Ad

Viewers also liked (20)

PPT
Cs 1114 - lecture-8
PPT
Cs 1114 - lecture-5
PPT
Cs 1114 - lecture-10
PPT
Cs 1114 - lecture-2
PPT
Cs 1114 - lecture-3
PPT
Cs 1114 - lecture-29
PPTX
Citizenship
PDF
Ideas training profile 2011
PPT
Inclusive-Education-BG
PPTX
Taller #1 diaz montenegro carolina 7 1
PPT
Cs 1114 - lecture-9
PPT
Final logic presentation
PPT
Cs 1114 - lecture-6
PPTX
Poet dreams
PPT
Usability Testing (Тестирование юзабилити)
PPTX
Microsoft TechDays 2012 France - BPOS301 La réversibilité des données dans le...
PDF
Microsoft Word - Projet Rocare IFEF
PDF
Impact de l'intelligence artificielle sur le marketing
PDF
Vin et digital, quelles opportunités pour votre marque ?
PPT
Séminaire FROTSI Midi-Pyrénées - CDT Tarn
Cs 1114 - lecture-8
Cs 1114 - lecture-5
Cs 1114 - lecture-10
Cs 1114 - lecture-2
Cs 1114 - lecture-3
Cs 1114 - lecture-29
Citizenship
Ideas training profile 2011
Inclusive-Education-BG
Taller #1 diaz montenegro carolina 7 1
Cs 1114 - lecture-9
Final logic presentation
Cs 1114 - lecture-6
Poet dreams
Usability Testing (Тестирование юзабилити)
Microsoft TechDays 2012 France - BPOS301 La réversibilité des données dans le...
Microsoft Word - Projet Rocare IFEF
Impact de l'intelligence artificielle sur le marketing
Vin et digital, quelles opportunités pour votre marque ?
Séminaire FROTSI Midi-Pyrénées - CDT Tarn
Ad

Similar to Cs 1114 - lecture-4 (20)

PPT
Cs 1114 - lecture-7
PPT
Fundamental Programming Lect 3
PDF
Four 4s lesson_plan
PPTX
Smart Strategy for SAT Preparation
PPTX
Accessing student performance by nlp
PDF
Excerpts from the GRE Playbook 2014
PPT
Covidien Dc Work Keys 101 2
PPT
PPSX
Caveon webinar series Standard Setting for the 21st Century, Using Informa...
PPTX
Wiat iii indtest report
PPT
Testcase design techniques final
PPTX
1-4-Slide-Show-Order-of-Operations-with-Parentheses.pptx
DOCX
Assignment Brief 201415Assignment DetailsThis assignment .docx
PPTX
Examination preparation and success.pptx
PPTX
Bohdan zinichenko rozsokha_shchukina
PPS
Test case design_the_basicsv0.4
PPTX
Machine learning and_nlp
PPT
The MSP Overview
PPTX
Using Mastery Manager to Inform Instruction
PPTX
March institute mm presentation
Cs 1114 - lecture-7
Fundamental Programming Lect 3
Four 4s lesson_plan
Smart Strategy for SAT Preparation
Accessing student performance by nlp
Excerpts from the GRE Playbook 2014
Covidien Dc Work Keys 101 2
Caveon webinar series Standard Setting for the 21st Century, Using Informa...
Wiat iii indtest report
Testcase design techniques final
1-4-Slide-Show-Order-of-Operations-with-Parentheses.pptx
Assignment Brief 201415Assignment DetailsThis assignment .docx
Examination preparation and success.pptx
Bohdan zinichenko rozsokha_shchukina
Test case design_the_basicsv0.4
Machine learning and_nlp
The MSP Overview
Using Mastery Manager to Inform Instruction
March institute mm presentation

Recently uploaded (20)

PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPT
Teaching material agriculture food technology
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Empathic Computing: Creating Shared Understanding
PPTX
A Presentation on Artificial Intelligence
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Big Data Technologies - Introduction.pptx
Assigned Numbers - 2025 - Bluetooth® Document
Network Security Unit 5.pdf for BCA BBA.
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Digital-Transformation-Roadmap-for-Companies.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Teaching material agriculture food technology
A comparative analysis of optical character recognition models for extracting...
Reach Out and Touch Someone: Haptics and Empathic Computing
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
The AUB Centre for AI in Media Proposal.docx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Empathic Computing: Creating Shared Understanding
A Presentation on Artificial Intelligence
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Big Data Technologies - Introduction.pptx

Cs 1114 - lecture-4

  • 2. Recap of Previous Lectures To solve a problem using computers, we need to do the following: Define the problem (in terms of inputs, outputs and processing) Design a solution for it (using a graphical approach) Symbols used Oval – Start and Stop Parallelogram – Input and Output Rectangle - Processing Diamond - Decision box Programming Fundamentals | Lecture-4
  • 3. Recap of Previous Lectures Problems we looked at Sum, Product, Difference of two numbers Square or cube of a number Solving an equation or a formula involving 3, 4 variables Example Some formulae from elementary physics or an algebraic equation Programming Fundamentals | Lecture-4
  • 4. Recap of Previous Lectures Decision making is required in many real-world problems Computer programs can be very useful in this regard To incorporate decision making in our solutions we learnt the usage of “Decision box” Programming Fundamentals | Lecture-4 Decision Rule Yes No Always in the form whose answer is “ Yes” or “No”
  • 5. Recap of Previous Lectures We always make comparisons in a decision box or Decision Rules are always in the form of comparisons Examples difference < 0 sum > 0 number2 != 0 marks >= 50 Programming Fundamentals | Lecture-4
  • 6. Recap of Previous Lectures To determine the usage of decision rule, follow these steps Define inputs and outputs Is decision-making required in this solution? What are the basis of decision? the thing which is required to make a decision will appear in the decision box What kind of comparison is required in the decision box? Programming Fundamentals | Lecture-4
  • 7. Recap of Previous Lectures Problems we looked at Checking negativity of a number Checking equality of two numbers Multiplying or Dividing two numbers conditionally Checking status of a student Programming Fundamentals | Lecture-4
  • 8. Tasks (from previous lecture) Find whether the sum of two numbers is greater than 50 Find whether the sum of two numbers is greater than the third number? Divide a number by another if only if the second number is not equal to “0” Determine whether a student is “passed” or “failed” from his marks A student securing marks less than 50 is considered “failed” Programming Fundamentals | Lecture-4
  • 9. Decision Rules So far 1 decision rule in a decision box Examples difference < 0 number2 != 0 marks < 50 Programming Fundamentals | Lecture-4 difference < 0 number2 != 0 marks< 50
  • 10. Consider This Example Divide a number by another if the second number is greater than “0” and less than “10” Divide a number by another if the second number is between “0” and “10” (also known as range check) Programming Fundamentals | Lecture-4 OR
  • 11. Programming Fundamentals | Lecture-4 START READ num1, num2 DISPLAY answer STOP answer = num1 / num2 num2 > 0 Yes No
  • 12. More than 1 Decision Rule Programming Fundamentals | Lecture-4 START READ num1, num2 DISPLAY answer STOP answer = num1 / num2 num2 > 0 AND num2 < 10 Yes No
  • 13. Another Example Add two numbers if either of them is “0” Programming Fundamentals | Lecture-4
  • 14. Another Example Determine status of a Students from marks of two of his subjects If marks for both the subjects are greater than 40 he’s considered passed Programming Fundamentals | Lecture-4
  • 15. Another Example Determine status of a Students from marks of two of his subjects If marks for any of the subjects is greater than 40 he’s considered passed Programming Fundamentals | Lecture-4
  • 16. Programming Fundamentals | Lecture-4 BE PREPARED FOR ON-THE-SPOT TEST IN NEXT LECTURE