1 / 12

CS 101 INTRODUCTION TO COMPUTER SCIENCES

CS 101 INTRODUCTION TO COMPUTER SCIENCES. DEPARTMENT OF COMPUTER SCIENCES. Pseudocode and Flowchart. Pseudocode is an informal high-level description of the operating principle of a computer program or other algorithm. It is the Natural Language representation of a Program or algorithm

lonna
Télécharger la présentation

CS 101 INTRODUCTION TO COMPUTER SCIENCES

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. CS 101 INTRODUCTION TO COMPUTER SCIENCES DEPARTMENT OF COMPUTER SCIENCES

  2. Pseudocode and Flowchart • Pseudocode is an informal high-level description of the operating principle of a computer program or other algorithm. • It is the Natural Language representation of a Program or algorithm • It uses the structural conventions of a programming language, but is intended for human reading rather than machine reading • It is used to explain a program to someone who may not understand the particular programming language in which it was made

  3. Pseudocode generally does not actually obey the syntax rules of any particular language There is no systematic standard form, although any particular writer will generally borrow style and syntax Popular syntax sources include Pascal, BASIC, C, C++, Java, Lisp, and ALGOL. Variable declarations mostly omitted. Function calls and blocks of code, such as code contained within a loop, are often replaced by a one-line natural language sentence

  4. Function CountToHundred For n = 1 to 100 do print n End _________________________________ Function AccessPassword Read n If n = “zebra” Write “Access Granted” Else write “Access denied” End If

  5. Pascal style pseudocode • procedure fizzbuzz • for i := 1 to 100 do • set print_number to true; • if i is divisible by 3 • then print "Fizz"; • set print_number to false; • if i is divisible by 5 then print "Buzz"; • set print_number to false; • if print_number, print i; • print a newline; • end

  6. Flowchart is the diagrammatical representation of an algorithm. • Steps are described in boxes of various kinds, and their order indicated by connecting them with arrows • Flowcharts are used in analyzing, designing, documenting or managing a process or program.

  7. Symbols Used in Flowchart Design • Terminals: these Symbols (ovals) either indicate the beginning or the end of a process

  8. Process: represented by a rectangle. It is used to denote an active process e.g. “1+2”

  9. Decision: The diamond symbol is used to signify a logical decision or comparison.

  10. Input/output: The Parallelogram is used to signify an input or output from some user or external program

  11. EXAMPLES

More Related