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

Items saved from this book

This book has been saved
Highlights (0)
Some of your highlights are legacy items.

Highlights saved before July 30, 2012 will not be displayed on their respective source pages.

You can easily re-create the highlights by opening the book page or article, selecting the text, and clicking “Highlight.”

Citations (0)
Some of your citations are legacy items.

Any citation created before July 30, 2012 will labeled as a “Cited page.” New citations will be saved as cited passages, pages or articles.

We also added the ability to view new citations from your projects or the book or article where you created them.

Notes (0)
Bookmarks (0)

You have no saved items from this book

Project items include:
  • Saved book/article
  • Highlights
  • Quotes/citations
  • Notes
  • Bookmarks
Notes
Cite this page

Cited page

Style
Citations are available only to our active members.
Sign up now to cite pages or passages in MLA, APA and Chicago citation styles.

(Einhorn, 1992, p. 25)

(Einhorn 25)

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 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?

Full screen
/ 320

matching results for page

Cited passage

Style
Citations are available only to our active members.
Sign up now to cite pages or passages in MLA, 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."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

Welcome to the new Questia Reader

The Questia Reader has been updated to provide you with an even better online reading experience.  It is now 100% Responsive, which means you can read our books and articles on any sized device you wish.  All of your favorite tools like notes, highlights, and citations are still here, but the way you select text has been updated to be easier to use, especially on touchscreen devices.  Here's how:

1. Click or tap the first word you want to select.
2. Click or tap the last word you want to select.

OK, got it!

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.

For full access in an ad-free environment, sign up now for a FREE, 1-day trial.

Already a member? Log in now.