Your SlideShare is downloading. ×
Chapter 2 representation of algorithms 2
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Chapter 2 representation of algorithms 2

1,909

Published on

Published in: Business, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,909
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
103
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Flowcharting IT 12 | Fundamentals of Programming and Database Theory and Applications Ms. Jennifer O. Calleja | IT Instructor
  • 2. Objectives
    • Upon completion of this chapter, you should be able to:
        • • Know the main steps for problem solving.
        • • Define term flowchart.
        • • List and discus advantages and disadvantages of flowchart as a logic development tool.
        • • Solve word problems using flowcharts.
    Ms. Jennifer O. Calleja | IT Instructor
  • 3. Steps in Problem solving
    • The first step in problem solving is to define the problem. The problem statement should be examined carefully to fully determine what question should be answered.
        • For example, consider this problem. A farmer had 100 chicken and all but 20 of them died. How many chicken does the farmer have left?
    Ms. Jennifer O. Calleja | IT Instructor
  • 4. Steps in Problem solving
    • 2. After the problem is defined, the next step is to assemble all given data and to assign variable names to those quantities which are unknown.
      • example:
      • Like the following statement:
      • Let r = the radius of the circle
    Ms. Jennifer O. Calleja | IT Instructor
  • 5. Steps in Problem solving
    • 3. Next, all unnecessary information should be discarded. Many problems contain information which has no meaning to the solution.
      • Consider this problem:
      • A man received a check for 300 thousand pesos of which he deposited 120 thousand pesos into his account. If his account balance was 200 thousand pesos after this deposit, how much was his balance before the deposit?
    Ms. Jennifer O. Calleja | IT Instructor
  • 6. Steps in Problem solving
    • 4. The next step is to discover relationships between the data express these relationships as equations.
    Ms. Jennifer O. Calleja | IT Instructor
  • 7. Steps in Problem solving
    • For example, read the radius of the circle from the keyboard then find its area and circumference.
        • Let R = the radius of the circle
        • Let A = the area of the circle
        • Let C = the circumference of the circle
        • Thus,
        • A = π * r * r
        • C = 2 * π * r
        • Represents the relationships in the problem
    Ms. Jennifer O. Calleja | IT Instructor
  • 8. Steps in Problem solving
    • 5. The final step of problem solving is to arrange the equations into an algorithm. After the algorithm is established, the actual procedures may be executed by either the computer or manually.
    Ms. Jennifer O. Calleja | IT Instructor
  • 9. Flowchart
    • a tool developed in the computer industry, for showing the steps involved in a process.
    • A flowchart is a diagram made up of boxes, diamonds and other shapes, connected by arrows - each shape represents a step in the process, and the arrows show the order in which they occur.
    Ms. Jennifer O. Calleja | IT Instructor
  • 10. Flowcharting Symbols Ms. Jennifer O. Calleja | IT Instructor Process Indicates any type of internal operation inside the Processor or Memory Input|output Used for any Input / Output (I/O) operation. Indicates that the computer is to obtain data or output results
  • 11. Flowcharting Symbols Ms. Jennifer O. Calleja | IT Instructor Decision Used to ask question that can be answered by True or false | yes or no connector Allows the flowchart to be drawn without intersecting lines or without a reverse flow
  • 12. Flowcharting Symbols Ms. Jennifer O. Calleja | IT Instructor Terminal Indicates the starting or ending of the program process or interrupt program Flow lines Shows direction of flow
  • 13. General Rules for Flowcharting
    • The flowchart should be clear, neat and easy to follow.
    • The usual direction of the flow of a procedure or a system is from left to right or top to bottom.
    • Only one flow line should come out or from a process symbol.
    Ms. Jennifer O. Calleja | IT Instructor
  • 14. General Rules for Flowcharting
    • Only one flow line should enter a decision symbol, but two or three flow lines, one for each possible answer, should leave the decision symbol.
    • Only one flow line is used in conjunction with terminal symbol.
    Ms. Jennifer O. Calleja | IT Instructor
  • 15. General Rules for Flowcharting
    • All boxes of the flowchart are connected with arrows
    • Flowchart symbols have an entry point on the top of the symbol with no other entry points. The exit point for all flowchart symbols is on the bottom except for the DECISION SYMBOL.
    • The Decision Symbol has two exit points; these can be on the sides or the bottom and one side.
    Ms. Jennifer O. Calleja | IT Instructor
  • 16. Advantages of Flowcharting
    • Good way of Communicating
    • Effective analysis
    • Proper documentation
    • Efficient coding
    • Proper debugging
    • Efficient program maintenance
    Ms. Jennifer O. Calleja | IT Instructor
  • 17.
    • Draw a flowchart to find the sum of first 10 natural numbers.
    • This means that we want to find sum where sum is given by:
    • Sum = 1 + 2 + 3 + ………………… 9 + 10.
    Ms. Jennifer O. Calleja | IT Instructor
  • 18. Pseudocode
    • is one of the tools that can be used to write a preliminary plan that can be developed into a computer program
    • a generic way of describing an algorithm without use of any specific programming language syntax.
    Ms. Jennifer O. Calleja | IT Instructor

×