1 / 16

Flowcharting

Flowcharting. What is Flowcharting?. Is a graphical representation of the logical sequence of steps to be performed in a program. It contains all the three stages of data processing namely: Input Process and Output. General Input/Output Symbol Decision Symbol Flowline Symbol.

cleta
Télécharger la présentation

Flowcharting

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Flowcharting

  2. What is Flowcharting? • Is a graphical representation of the logical sequence of steps to be performed in a program. • It contains all the three stages of data processing namely: • Input • Process and • Output

  3. General Input/Output Symbol • Decision Symbol • Flowline Symbol

  4. Process Symbol • Terminal Symbol

  5. Flowchart Control Structures • Control structures are necessary to organize the flow of control in a program, in order to provide discipline in the development of a program design. These structures are also referred to as “single-entry, single-exit” structures. They do not allow arbitrary transfer to any other structure without passing the exit point. The combination of these structures are the building blocks of flowcharts and program coding.

  6. Sequence Structure • The sequence structure indicates that control flows from one processing to another. • It represent events that occur immediately one after another. The statements are execute sequentially in the order in which they appear in the program.

  7. Sequence Structure BEGIN Input Data Process Data Output Data End

  8. Num1=0 Sum=0 Num2=0 Ave=0 Num3=0 Example 1:Make a flowchart that will input three numbers, compute its sum and average and display it on screen. Begin Input Num1, Num2, Num3 Compute Sum=Num1+Num2+Num3 Compute Ave=(Num1+Num2+Num3)/3 Display “The sum is”, Sum “The average is”, Ave End

  9. Selection Structure • Is used to test a condition and provide for a choice between two alternatives. They entry point is by means of the condition that has to be tested. Based on the outcome of the condition tested, program control branches out to either true/yes segment of the program or to a false/no segment. If the condition is satisfied, then the program will branch to the true/yes segment will be executed and the flow goes to the exit. If the condition is not satisfied, then it will branch to the false/no segment and the flow goes to the exit.

  10. Selection Structure BEGIN Input Data Condition Process Data Process Data Output Data END

  11. Example 2:Make a flowchart that determines the larger and smaller number between two input numbers and output the results BEGIN Input A, B False If A > B Big = B Small = A True Big = A Small = B END

  12. Repetition/Iteration or Looping Structure • The iteration or looping structure occurs when an event is repeatedly performed as long as a given condition is true or is false as the case may be. The iteration structure provides a means of repeating a part of the computation/instruction. It is therefore, useful for processing a large number of records or data that require the same process.

  13. Repetition/Iteration or Looping Structure entry Previous Statements Body of the Loop Loop – Exit Condition Yes No

  14. Example 3:Create a program that allows the user to input his name and the program should display/output his name 10 times on the computer screen Begin End Yes If Loop > 10 Then Input Name Loop:=Loop +1 No Write Name Loop:=1

  15. Hands-on Activities • Make a flowchart that computes the sum from 1 to 50 and displays its sum. • Make a flowchart on how to process a cup of coffee. (No hot water available yet). • Make a flowchart that inputs the name and the age of the user and it will display the message “You are too young to fall in love” if age is less than 16. • Write a flowchart that will test if the input number is divisible by2. • Write the flowchart that will input 5 of your favorite songs and will store it in the diskette. (note: use store data symbol for storing the songs in he diskette.)

More Related