|
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
algorithm/programProblem specifications sometimes have *too much* information
Problem specifications sometimes have *not enough* informationPseudocode – a tool programmers use to help them plan a program.
Usually human understandable, but computers can not (i.e. not language
specific)Flowchart – uses standardized symbols to show the steps of an
algorithmValid Data – data which the programmer is expecting the user to
enter.Invalid Data – data which the programmer is not expecting the user
to enter.variables – memory locations that the computer uses to store
information.keywords – words which have a special meaning in a programming
language.statement – an instruction to perform an operation.
streams – sequence of characters used by C++ for input and output.
example:INPUT: cin >> length; >> called the extraction
operator
OUTPUT: cout << “This is output.” – <<
called the insertion operatorendl – 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:
Numbers
Whole Numbers – can not have a part of a number
- byte
- int
- long
Fractional (Decimal) – can have part of a whole, or fractional
values. eg: 3.1
- float
- double
Strings
- 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;
Copyright ©2001-2002, Walter Wimberly – Instructor and all |