Document Details

StylishSlideWhistle

Uploaded by StylishSlideWhistle

Ujjaval Patel

Tags

flowchart algorithm programming computer science

Summary

This document explains aspects of problem solving, flowcharts, and algorithms. It includes examples of different algorithms and flowcharts for various tasks such as finding the sum of two numbers and the largest number among three. Useful for understanding introductory computer programming concepts.

Full Transcript

9/12/2024 Aspects of Problem Solving  Understand the Problem  Formulate a Model  Develop an Algorithm  Write the Program  Test the Program  Evaluate the Solution 1 Flowchart  Diagrammatic representation of logic for solving task  Drawn using boxes of different shapes w...

9/12/2024 Aspects of Problem Solving  Understand the Problem  Formulate a Model  Develop an Algorithm  Write the Program  Test the Program  Evaluate the Solution 1 Flowchart  Diagrammatic representation of logic for solving task  Drawn using boxes of different shapes with lines connecting them to show the flow of control  Make the logic of the program clearly in a visual form  Diagrammatic representation forms a common medium of communication  Drawn using different kinds of symbols. 2 1 9/12/2024 Flowchart Symbols 3 Flowchart Symbols 4 2 9/12/2024 Flowchart Symbols 5 Flowchart Symbols 6 3 9/12/2024 Number is positive or negative Step 1: Read no. Start Step 2: If no is greater than equal zero, go to step 4. Read no Step 3: Print no is a negative number, go to step 5. True False Step 4: Print no is a positive Is no >= 0 number. Step 5: Stop. Print no is Print no is Positive Negative Stop #3110003 (PPS) – Introduction to computer and Dr.Dr.Ujjaval Ujjaval Patel(AIIE) Patel 7 programming 7 Number is odd or even Step 1: Read no. Start Step 2: If no mod 2 = 0, go to step 4. Read no Step 3: Print no is a odd, go to step 5. True Is no % 2 = False Step 4: Print no is a even. 0 Step 5: Stop. Print no is Print no is Even Odd Stop #3110003 (PPS) – Introduction to computer and Dr.Dr.Ujjaval Ujjaval Patel(AIIE) Patel 8 programming 8 4 9/12/2024 Largest number from 2 numbers Step 1: Read a, b. Start Step 2: If a>b, go to step 4. Step 3: Print b is largest number, Read a, b go to step 5. Step 4: Print a is largest number. True False Step 5: Stop. Is a>b Print a is Print b is largest largest Stop #3110003 (PPS) – Introduction to computer and Dr.Dr.Ujjaval Ujjaval Patel(AIIE) Patel 9 programming 9 Largest number from 3 numbers (Flowchart) Start Read a, b, c True False Is a>b True False True False Is a>c Is b>c Print a is Print c is Print b is Print c is largest largest largest largest Stop #3110003 (PPS) – Introduction to computer and Dr.Dr.Ujjaval Ujjaval Patel(AIIE) Patel 10 programming 10 5 9/12/2024 Print 1 to 10 Step 1: Initialize a to 1. Start Step 2: Print a. Step 3: Repeat step 2 until a=1 a

Use Quizgecko on...
Browser
Browser