Teaching and Learning Computer Programming: Multiple Research Perspectives

By Richard E. Mayer | Go to book overview

APPENDIX: EXAMPLES OF THE PRINCIPAL PASCAL STATEMENTS DISCUSSED

READ Statement

Pascal actually reads values from the data-stream in order, so if the program and data are:

PROGRAM B1;
VAR First, Smallest, Largest: INTEGER;
BEGIN
WRITELN('Enter three numbers);
READLN (Largest,Smallest, First)
END.
[5 10 1]

Largest would be assigned the value 5, Smallest 10, and First 1. Note that a variable can contain only a single value at any point. (This note is relevant to all the difficulties that arise with READLN statements.)


Print Statement

The WRITELN command merely causes whatever is in the string to be printed on an output device, say a terminal. It has no effect on any of the user defined variables. So

WRITELN('Set variable X to 999')

has no effect whatsoever on the value of the variable X.


Assignment Statement
A:= 2 (sets the value of variable A to 2)
B:= 3 (sets the value of variable B to 3)
A:= B (sets the value of A to B, i.e. to 3, and 2 is "overwritten")

A standard variable can contain only a single value at any point in the program's execution.


Variables

Variables are entities that are used to retain intermediary values of computations. Suppose we need to calculate the annual rainfall of Glencoe-a nontrivial computation. If this value were to be processed in several ways, it would be

-255-

Notes for this page

Add a new note
If you are trying to select text to create highlights or citations, remember that you must now click or tap on the first word, and then click or tap on the last word.
One moment ...
Default project is now your active project.
Project items
Notes
Cite this page

Cited page

Style
Citations are available only to our active members.
Buy instant access to cite pages or passages in MLA 8, MLA 7, APA and Chicago citation styles.

(Einhorn, 1992, p. 25)

(Einhorn 25)

(Einhorn 25)

1. Lois J. Einhorn, Abraham Lincoln, the Orator: Penetrating the Lincoln Legend (Westport, CT: Greenwood Press, 1992), 25, http://www.questia.com/read/27419298.

Note: primary sources have slightly different requirements for citation. Please see these guidelines for more information.

Cited page

Bookmark this page
Teaching and Learning Computer Programming: Multiple Research Perspectives
Table of contents

Table of contents

Settings

Settings

Typeface
Text size Smaller Larger Reset View mode
Search within

Search within this book

Look up

Look up a word

  • Dictionary
  • Thesaurus
Please submit a word or phrase above.
Print this page

Print this page

Why can't I print more than one page at a time?

Help
Full screen
Items saved from this book
  • Bookmarks
  • Highlights & Notes
  • Citations
/ 320

matching results for page

    Questia reader help

    How to highlight and cite specific passages

    1. Click or tap the first word you want to select.
    2. Click or tap the last word you want to select, and you’ll see everything in between get selected.
    3. You’ll then get a menu of options like creating a highlight or a citation from that passage of text.

    OK, got it!

    Cited passage

    Style
    Citations are available only to our active members.
    Buy instant access to cite pages or passages in MLA 8, MLA 7, APA and Chicago citation styles.

    "Portraying himself as an honest, ordinary person helped Lincoln identify with his audiences." (Einhorn, 1992, p. 25).

    "Portraying himself as an honest, ordinary person helped Lincoln identify with his audiences." (Einhorn 25)

    "Portraying himself as an honest, ordinary person helped Lincoln identify with his audiences." (Einhorn 25)

    "Portraying himself as an honest, ordinary person helped Lincoln identify with his audiences."1

    1. Lois J. Einhorn, Abraham Lincoln, the Orator: Penetrating the Lincoln Legend (Westport, CT: Greenwood Press, 1992), 25, http://www.questia.com/read/27419298.

    Cited passage

    Thanks for trying Questia!

    Please continue trying out our research tools, but please note, full functionality is available only to our active members.

    Your work will be lost once you leave this Web page.

    Buy instant access to save your work.

    Already a member? Log in now.

    Search by... Author
    Show... All Results Primary Sources Peer-reviewed

    Oops!

    An unknown error has occurred. Please click the button below to reload the page. If the problem persists, please try again in a little while.