SlideShare a Scribd company logo
1 of 24
Programming Fundamentals
Assignment-1 Solution Programming Fundamentals | Lecture-9 (m == 3 AND d >= 21) OR (m == 4 AND d <= 19) Period Meaning March 21 – April 19 If Month is 3 then Day must be 21 st  or above Or if Month is 4 then Day must be 19 th  or below
Wrong Decision Rules Programming Fundamentals | Lecture-9 m == 3  OR m == 4 m == 4  OR m == 5 DISPLAY “Aries”
Wrong Decision Rules Programming Fundamentals | Lecture-9 (m == 3 AND  d >= 21 AND d <= 31) (m == 4 AND  d >= 20 AND d <= 30)
Less Better Approach Programming Fundamentals | Lecture-9 m == 3 m == 4 Further rules
Lessons from Previous Lecture ,[object Object],[object Object],Programming Fundamentals | Lecture-9
Lessons from Previous Lecture ,[object Object],Programming Fundamentals | Lecture-9 count = count + 1 count < n count = 0 Yes 1 or more steps
Lessons from Previous Lecture ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Programming Fundamentals | Lecture-9
Lessons from Previous Lecture ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Programming Fundamentals | Lecture-9
Another Example ,[object Object],[object Object],[object Object],[object Object],[object Object],Programming Fundamentals | Lecture-9
Sum of first 5 even numbers Programming Fundamentals | Lecture-9 START sum = 0 count = count + 1 STOP count < 5 count = 0 DISPLAY sum Yes No sum = sum + count + count
Alternative Programming Fundamentals | Lecture-9 START sum = 0 count = count + 1 STOP count < 5 count = 0 DISPLAY sum Yes No sum = sum + even even = 0 even = even + 2
Another Example ,[object Object],[object Object],Programming Fundamentals | Lecture-9
Sum of first n odd numbers Programming Fundamentals | Lecture-9 START sum = 0 count = count + 1 STOP count < n count = 0 DISPLAY sum Yes No sum = sum + count + count - 1
Alternative Programming Fundamentals | Lecture-9 START sum = 0 count = count + 1 STOP count < 5 count = 0 DISPLAY sum Yes No sum = sum + odd odd = -1 odd = odd + 2
Consider This ,[object Object],[object Object],[object Object],Programming Fundamentals | Lecture-9
Display first n even numbers Programming Fundamentals | Lecture-9 START count = count + 1 STOP count < 5 count = 0 Yes No DISPLAY even even = 0 even = even + 2
Another Example ,[object Object],[object Object],[object Object],Programming Fundamentals | Lecture-9
Table of a number up to 10 Programming Fundamentals | Lecture-9 START count = count + 1 STOP count < 10 count = 0 Yes No DISPLAY num * count READ num
Another Example ,[object Object],[object Object],Programming Fundamentals | Lecture-9
Programming Fundamentals | Lecture-9 START sum = 0 count = count + 1 STOP count < 5 count = 0 DISPLAY sum Yes No sum = sum + count + 25
Testing Programming Fundamentals | Lecture-9 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 = 0 + 1 2 = 1 + 1 3 = 2 + 1 4 = 3 + 1 5 = 4 + 1 sum  =  sum  +  count +25 26 =  0 + (1 + 25)   53 =  26 + (2 + 25) 81 =  53 + (3 + 25) 110 =  81 + (4 + 25) 140 =  110 + (5 + 25)
A Challenging Task ,[object Object],[object Object],Programming Fundamentals | Lecture-9
Programming Fundamentals | Lecture-9 BE PREPARED FOR  QUIZ IN NEXT LECTURE

More Related Content

What's hot

Adding and Subtracting Decimals
Adding and Subtracting DecimalsAdding and Subtracting Decimals
Adding and Subtracting DecimalsJaizaDemecillo
 
Lesson 19
Lesson 19Lesson 19
Lesson 19NRWEG3
 
Lesson 18
Lesson 18Lesson 18
Lesson 18NRWEG3
 
Adding & Subtracting Decimals
Adding & Subtracting DecimalsAdding & Subtracting Decimals
Adding & Subtracting DecimalsRileyAntler
 
Powerpoint on adding and subtracting decimals notes
Powerpoint on adding and subtracting decimals notesPowerpoint on adding and subtracting decimals notes
Powerpoint on adding and subtracting decimals notesLea Perez
 
Answering Techniques Ad Maths P1
Answering Techniques Ad Maths P1Answering Techniques Ad Maths P1
Answering Techniques Ad Maths P1morabisma
 
January 13, 2014
January 13, 2014January 13, 2014
January 13, 2014khyps13
 
Triâng. classif. qto lados aula 77 (21-09)
Triâng. classif. qto lados  aula 77 (21-09)Triâng. classif. qto lados  aula 77 (21-09)
Triâng. classif. qto lados aula 77 (21-09)RosanaRulli
 
8th pre alg -l78
8th pre alg -l788th pre alg -l78
8th pre alg -l78jdurst65
 
Sept. 21, 2012
Sept. 21, 2012Sept. 21, 2012
Sept. 21, 2012khyps13
 
Tic Tac Toe Factoring
Tic Tac Toe FactoringTic Tac Toe Factoring
Tic Tac Toe FactoringDon Simmons
 
7th math c2 -l75
7th math c2 -l757th math c2 -l75
7th math c2 -l75jdurst65
 
Paperhanging Clculations
Paperhanging Clculations Paperhanging Clculations
Paperhanging Clculations michael mcewan
 
Factoring Trinomials
Factoring TrinomialsFactoring Trinomials
Factoring TrinomialsDon Simmons
 
Teoria y problemas de numeros racionales qa84 ccesa007
Teoria y problemas de numeros racionales qa84 ccesa007Teoria y problemas de numeros racionales qa84 ccesa007
Teoria y problemas de numeros racionales qa84 ccesa007Demetrio Ccesa Rayme
 
Area of Irregular Figures
Area of Irregular FiguresArea of Irregular Figures
Area of Irregular Figuresmanswag123
 

What's hot (17)

Adding and Subtracting Decimals
Adding and Subtracting DecimalsAdding and Subtracting Decimals
Adding and Subtracting Decimals
 
Lesson 19
Lesson 19Lesson 19
Lesson 19
 
Lesson 18
Lesson 18Lesson 18
Lesson 18
 
Adding & Subtracting Decimals
Adding & Subtracting DecimalsAdding & Subtracting Decimals
Adding & Subtracting Decimals
 
Powerpoint on adding and subtracting decimals notes
Powerpoint on adding and subtracting decimals notesPowerpoint on adding and subtracting decimals notes
Powerpoint on adding and subtracting decimals notes
 
Answering Techniques Ad Maths P1
Answering Techniques Ad Maths P1Answering Techniques Ad Maths P1
Answering Techniques Ad Maths P1
 
January 13, 2014
January 13, 2014January 13, 2014
January 13, 2014
 
Triâng. classif. qto lados aula 77 (21-09)
Triâng. classif. qto lados  aula 77 (21-09)Triâng. classif. qto lados  aula 77 (21-09)
Triâng. classif. qto lados aula 77 (21-09)
 
8th pre alg -l78
8th pre alg -l788th pre alg -l78
8th pre alg -l78
 
Sept. 21, 2012
Sept. 21, 2012Sept. 21, 2012
Sept. 21, 2012
 
Tic Tac Toe Factoring
Tic Tac Toe FactoringTic Tac Toe Factoring
Tic Tac Toe Factoring
 
Tafe presentation
Tafe presentationTafe presentation
Tafe presentation
 
7th math c2 -l75
7th math c2 -l757th math c2 -l75
7th math c2 -l75
 
Paperhanging Clculations
Paperhanging Clculations Paperhanging Clculations
Paperhanging Clculations
 
Factoring Trinomials
Factoring TrinomialsFactoring Trinomials
Factoring Trinomials
 
Teoria y problemas de numeros racionales qa84 ccesa007
Teoria y problemas de numeros racionales qa84 ccesa007Teoria y problemas de numeros racionales qa84 ccesa007
Teoria y problemas de numeros racionales qa84 ccesa007
 
Area of Irregular Figures
Area of Irregular FiguresArea of Irregular Figures
Area of Irregular Figures
 

Similar to Programming Fundamentals Assignment Solution (m == 3 AND d >= 21) OR (m == 4 AND d <= 19

Cs 1114 - lecture-10
Cs 1114 - lecture-10Cs 1114 - lecture-10
Cs 1114 - lecture-10Zeeshan Sabir
 
Fundamental Programming Lect 3
Fundamental Programming Lect 3Fundamental Programming Lect 3
Fundamental Programming Lect 3Namrah Erum
 
Course project solutions 2019
Course project solutions 2019Course project solutions 2019
Course project solutions 2019Robert Geofroy
 
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 SolvingNuzhat Memon
 
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.pptxssuser2f67c91
 
sample ppt.ppt
sample ppt.pptsample ppt.ppt
sample ppt.pptJelmar2
 
Contéo de figuras
Contéo de figurasContéo de figuras
Contéo de figurasJesusBuelna2
 
276939732-P66-M1-B12-E.pdf
276939732-P66-M1-B12-E.pdf276939732-P66-M1-B12-E.pdf
276939732-P66-M1-B12-E.pdfsebastien25
 
15minute-math-integers.ppt
15minute-math-integers.ppt15minute-math-integers.ppt
15minute-math-integers.pptRicardoDeGuzman9
 
Solving Inequalities01
Solving Inequalities01Solving Inequalities01
Solving Inequalities01taco40
 
Saxman Hypermedia
Saxman HypermediaSaxman Hypermedia
Saxman Hypermediasdsaxman
 
6 2solving Inequalities
6 2solving Inequalities6 2solving Inequalities
6 2solving Inequalitiestaco40
 
Algebra Questions.pdf
Algebra Questions.pdfAlgebra Questions.pdf
Algebra Questions.pdfKathryn Patel
 

Similar to Programming Fundamentals Assignment Solution (m == 3 AND d >= 21) OR (m == 4 AND d <= 19 (20)

Cs 1114 - lecture-8
Cs 1114 - lecture-8Cs 1114 - lecture-8
Cs 1114 - lecture-8
 
Cs 1114 - lecture-10
Cs 1114 - lecture-10Cs 1114 - lecture-10
Cs 1114 - lecture-10
 
Fundamental Programming Lect 3
Fundamental Programming Lect 3Fundamental Programming Lect 3
Fundamental Programming Lect 3
 
Cs 1114 - lecture-3
Cs 1114 - lecture-3Cs 1114 - lecture-3
Cs 1114 - lecture-3
 
Course project solutions 2019
Course project solutions 2019Course project solutions 2019
Course project solutions 2019
 
Cs 1114 - lecture-5
Cs 1114 - lecture-5Cs 1114 - lecture-5
Cs 1114 - lecture-5
 
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
 
4. algorithm
4. algorithm4. algorithm
4. algorithm
 
ppt math6 qt3-wk3.pptx
ppt math6 qt3-wk3.pptxppt math6 qt3-wk3.pptx
ppt math6 qt3-wk3.pptx
 
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
 
Cs 1114 - lecture-7
Cs 1114 - lecture-7Cs 1114 - lecture-7
Cs 1114 - lecture-7
 
sample ppt.ppt
sample ppt.pptsample ppt.ppt
sample ppt.ppt
 
Contéo de figuras
Contéo de figurasContéo de figuras
Contéo de figuras
 
276939732-P66-M1-B12-E.pdf
276939732-P66-M1-B12-E.pdf276939732-P66-M1-B12-E.pdf
276939732-P66-M1-B12-E.pdf
 
15minute-math-integers.ppt
15minute-math-integers.ppt15minute-math-integers.ppt
15minute-math-integers.ppt
 
Solving Inequalities01
Solving Inequalities01Solving Inequalities01
Solving Inequalities01
 
Saxman Hypermedia
Saxman HypermediaSaxman Hypermedia
Saxman Hypermedia
 
6 2solving Inequalities
6 2solving Inequalities6 2solving Inequalities
6 2solving Inequalities
 
Algebra Questions.pdf
Algebra Questions.pdfAlgebra Questions.pdf
Algebra Questions.pdf
 
Math%20repurt
Math%20repurtMath%20repurt
Math%20repurt
 

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 presentationZeeshan Sabir
 
Human resource management process
Human resource management processHuman resource management process
Human resource management processZeeshan Sabir
 

More from Zeeshan Sabir (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

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
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 organizationRadu Cotescu
 
[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.pdfhans926745
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 

Recently uploaded (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
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
 
[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
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 

Programming Fundamentals Assignment Solution (m == 3 AND d >= 21) OR (m == 4 AND d <= 19

  • 2. Assignment-1 Solution Programming Fundamentals | Lecture-9 (m == 3 AND d >= 21) OR (m == 4 AND d <= 19) Period Meaning March 21 – April 19 If Month is 3 then Day must be 21 st or above Or if Month is 4 then Day must be 19 th or below
  • 3. Wrong Decision Rules Programming Fundamentals | Lecture-9 m == 3 OR m == 4 m == 4 OR m == 5 DISPLAY “Aries”
  • 4. Wrong Decision Rules Programming Fundamentals | Lecture-9 (m == 3 AND d >= 21 AND d <= 31) (m == 4 AND d >= 20 AND d <= 30)
  • 5. Less Better Approach Programming Fundamentals | Lecture-9 m == 3 m == 4 Further rules
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11. Sum of first 5 even numbers Programming Fundamentals | Lecture-9 START sum = 0 count = count + 1 STOP count < 5 count = 0 DISPLAY sum Yes No sum = sum + count + count
  • 12. Alternative Programming Fundamentals | Lecture-9 START sum = 0 count = count + 1 STOP count < 5 count = 0 DISPLAY sum Yes No sum = sum + even even = 0 even = even + 2
  • 13.
  • 14. Sum of first n odd numbers Programming Fundamentals | Lecture-9 START sum = 0 count = count + 1 STOP count < n count = 0 DISPLAY sum Yes No sum = sum + count + count - 1
  • 15. Alternative Programming Fundamentals | Lecture-9 START sum = 0 count = count + 1 STOP count < 5 count = 0 DISPLAY sum Yes No sum = sum + odd odd = -1 odd = odd + 2
  • 16.
  • 17. Display first n even numbers Programming Fundamentals | Lecture-9 START count = count + 1 STOP count < 5 count = 0 Yes No DISPLAY even even = 0 even = even + 2
  • 18.
  • 19. Table of a number up to 10 Programming Fundamentals | Lecture-9 START count = count + 1 STOP count < 10 count = 0 Yes No DISPLAY num * count READ num
  • 20.
  • 21. Programming Fundamentals | Lecture-9 START sum = 0 count = count + 1 STOP count < 5 count = 0 DISPLAY sum Yes No sum = sum + count + 25
  • 22. Testing Programming Fundamentals | Lecture-9 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 = 0 + 1 2 = 1 + 1 3 = 2 + 1 4 = 3 + 1 5 = 4 + 1 sum = sum + count +25 26 = 0 + (1 + 25) 53 = 26 + (2 + 25) 81 = 53 + (3 + 25) 110 = 81 + (4 + 25) 140 = 110 + (5 + 25)
  • 23.
  • 24. Programming Fundamentals | Lecture-9 BE PREPARED FOR QUIZ IN NEXT LECTURE