Basic knowledge for Programming Concepts C
Algorithm – a simple step-by-step instructions that describe how
to accomplish a task.
Desk Checking – also called Hand Tracing – method where you check
the results by stepping through each step in the algorithm by hand.
Program – a “coded” algorithm
Output – the goal of the program
IPO Chart – organizes Inputs, Processing, and Outputs of an
Problem specifications sometimes have *too much* information
Problem specifications sometimes have *not enough* information
Pseudocode – a tool programmers use to help them plan a program.
Usually human understandable, but computers can not (i.e. not language
Flowchart – uses standardized symbols to show the steps of an
Valid Data – data which the programmer is expecting the user to
Invalid Data – data which the programmer is not expecting the user
variables – memory locations that the computer uses to store
keywords – words which have a special meaning in a programming
statement – an instruction to perform an operation.
streams – sequence of characters used by C++ for input and output.
INPUT: cin >> length; >> called the extraction
OUTPUT: cout << “This is output.” – <<
called the insertion operator
endl – used to denote the end of line for output to the
screen. Flushes the buffer and makes a new line on the screen.
debugging – the process of removing errors from the program
syntax error – an instruction/statement which violates the rules
of a programming language.
Variables and Named Constants are locations in a computer’s memory where
a program can temporarily store data.
Types of variables:
Whole Numbers – can not have a part of a number
Fractional (Decimal) – can have part of a whole, or fractional
values. eg: 3.1
- string – multiple characters
- char – single character
Each variable has different memory requirements. And each will take
up the space of the whole variable type, regardless of the amount of usage.
Named Constants cannot change value while the program is running.
Are set by using the const keyword.
eg. const double PI = 3.1415;
The name of a variable is called its identifier
Assignment Statement – assigns a value to an existing variable
eg, x = 10;