Download
buffer n.
Skip this Video
Loading SlideShow in 5 Seconds..
buffer PowerPoint Presentation

buffer

142 Vues Download Presentation
Télécharger la présentation

buffer

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. buffer • Whenever a read or readln is executed and you type a line of data terminated by hitting ENTER, that line, along with the CR/LF end of line marker is stored as characters in a series of memory locations called the input buffer. • Remember CR and LF are stored as two separate characters

  2. Pointer • While data is in the buffer, the program keeps track of the location it will read the next data item from. • After read is used to read data, the pointer points to the character immediately to the right of the last character used. • Readln sets the pointer to the first character in the next line.

  3. Using Units • Unit: A group of compiled procedures, along with the definitions and declarations they use. • Standard Units: Predefined units that come with the Turbo Pascal compiler

  4. Standard Units • Crt: screen and keyboard procedures • DOS: allows use of DOS commands in program • System: (automatically included) standard functions and procedure • Printer: printer functions and procedures • Overlay, Graph: we will not use

  5. Using the Standard Units in a Program PROGRAM CleartheScreen; Uses CRT; {clears the screen} BEGIN ClrScr; END. Note: If you are using a fast machine, this may produce a division by zero error. In that case you need to install a unit called newdelay. If anyone has this problem email me.

  6. The Art of Programming Top-Down Design

  7. The Art of Problem Solving • The art of problem solving is the transformation of an English description of a problem into a form that permits a mechanical solution. • A straightforward example of this process is transforming an algebra word problem into a set of algebraic equations that can then be solved for the unknowns.

  8. Software Development Method • Requirements specification • Analysis • Design • Implementation or coding • Testing

  9. Requirements Specification • State the problem and gain a clear understanding of what is required for the solution. • Sounds easy but can be most difficult part • Must define the problem precisely • eliminate unimportant aspects • zero in on root problem

  10. Analysis • Identify input and outputs • What information should the solution provide? • What data do I have to work with? • Identify data types needed

  11. Design • Develop a list of steps to solve the problem. This is called an algorithm. • First list the major steps of the problem that need to be solved (subproblems) • Now attack each of the subproblems. This is call refining the algorithm. (this process is like divide and conquer)

  12. Implementation or Coding • Notice that until now the steps are the same regardless of the programming language you are using. • Translate your algorithm from pseudocode to Pascal. • Good programming style • comments