C173 – Scripting and Programming
Foundations – Notes
Chapter 1 – Introduction
- Programs consist of instructions executions one at a time. Basic instructions are
oInput – A program gets data, perhaps from a file, keyboard, touchscreen,
and network.
oProcess – A program performs computations on that data, such as adding
two values like x + y
oOutput – A program puts that data somewhere, such as to a file,
screen, network, etc.
- Variables – Refer to data like x, y, and z. Programs use variables. Name is due to
a variables value “varying” as a program assigns a variable like x with new
values.
- Algorithm - A sequence of instructions that solves a problem
- Flowchart – A graphical language for creating or viewing computer programs.
- Flowcharts use Coral language, a language intended for learning to program.
- Program is a list of statements, each statement carrying out some action and
executing one at a time. In a coral flowchart, each statement is in a graphical node,
with different shaped for different types of statements.
- Coral uses an interpreter to run a programs statement.
- Run and execute are words for carrying out a program’s statements.
- Program is a sequence of statements.
- Parallelogram represents an input statement, written as variable = get next input.
- Parallelogram also represent an output statement.
- String literal consists of text (characters) within double quotes example being “Go#57”
- Character includes any letter (a-z, A-Z,) digit (0-9), or symbol (~,!, @, etc.)
- Cursor indicates where the next output item will be placed in the output.
System automatically moves the cursor after the previously-output items.
- Newline – A special two-character sequence (\n) whose appearance in an output
string literal causes the cursor to move to the next output line. Exists invisibly in the
output.
- Comment is text a programmer adds to a program to be read by humans to
better understand the code but ignored by the program when executing. Coral
uses // for comments. Comment must be on its own line.
- Whitespace refers to blank spaces (space and tab characters) between items within