1 / 7

Problem solving Procedures

Problem solving Procedures. Flowcharts, pseudocode. What are Flowcharts, pseudo-code used for in solving problems?. A six-step problem solving procedure :. Problem identification.

simone
Download Presentation

Problem solving Procedures

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. Problem solving Procedures Flowcharts, pseudocode

  2. What are Flowcharts, pseudo-code used for in solving problems? A six-step problem solving procedure: Problem identification Algorithm – a finite sequence of steps arranged in a specific logical order to produce the solution to a problem. Problem analysis Algorithm design Flow chart and pseudo-code are two common ways to design and represent algorithms in details. Developing a solution Debugging and testing Documentation

  3. Flow chart • Schematic representation of an algorithm or a stepwise process • Showing the steps as boxes of various kinds, and their order by connecting these with arrows. • Used in designing or documenting a process or program. • The two most common types of boxes in a flowchart:a processing step (usually called activity, and denoted as a rectangular box) a decision (usually denoted as a diamond)

  4. Examples A flowchart forcalculating N!(factorial N)

  5. Pseudo-code • Informal high-level description of a computer programming algorithm that uses the structural conventions of some programming language • Intended for human reading rather than machine reading. • Easier to understand • Pseudo-code typically omits details that are not essential for human understanding of the algorithm • No standard for pseudo-code syntax exists • Commonly used • in textbooks • in scientific publications that are documenting various algorithms • in planning of computer program development • for sketching out the structure of the program before the actual coding takes place.

  6. Examples Regular code written in PHP: <?php if (is_valid($cc_number)) { execute_transaction($cc_number, $order); } else { show_failure(); } ?> Pseudo-code: if credit card number is valid then execute transaction based on number and order else show a generic failure message end if

  7. Start Flow chart: Find H.C.F. Input x, y Pseudo-code: Input x and y IF y is larger than x THEN swap x and y END IF r=remainder of x/y WHILE R<>0 BEGIN x=y y=r r=remainder of x/y END Output y y>x? Yes Swap x, y No R=remainder of x ÷ y R=0? No x=y y=r Yes Output y as H.C.F. End

More Related