|
Computer programming is the
process of selecting and applying commands, called instructions, to accomplish work
with a computer.
Instructions
are actually precisely described actions that are carried out by a computer.
Computer instructions are used to:
 |
Collect
input from a user or other source, e.g., a mortgage amount, interest rate, number of months. |
 | Store
data for short or long term periods
of time, e.g., storing the names, addresses, and phone numbers of employees in a
company. |
 | Make decisions
based on predetermined sets of rules or logic,
e.g., "if the mortgage payment is less than 33% of the monthly salary,
t
hen approve the loan." |
 | Generate output
to a user or other destination,
e.g., a picture of person is displayed on a computer monitor. |
The key to
programming a computer is to understand what you want to do (the job) and assigning the
detailed steps that will accomplish the job (the program).
Exercise: Programming
Yourself
The basis of programming is the use of
commands called instructions to make a computer do what you want it to do.
This exercise will help you to understand what programming is.
Consider the following
instructions:
 |
STAND
|
 |
SIT
|
 |
WALK
"number of steps", e.g., Walk 5 means take five steps.
|
 |
PICKUP
"object", e.g., Pickup "pencil" means take the pencil
into the hand.
|
 |
TURN
"direction", e.g., Turn left means turn 90 degrees left from
you're currently facing.
|
 |
IF
(obstacle) THEN (do this)
|
Write a set of directions that
will take you from your seat to the front of the room to pick up an object
such as a piece of chalk or marker.
Test your directions.
Did you have adequate directions
to accomplish the job? Were they
in the proper sequence? Consider this...these instructions are
relatively high level instructions, imagine if you had to control the
operation of your arms and legs or the contracting of muscles from one
moment to the next.
|
Computing Architecture
A computing architecture is the environment in which you
organize, manipulate, store, and manage data and information.
We are used to thinking of computers in terms of
hardware: keyboards, disk drives, and monitors.
Let's also consider a different perspective. A computer deals with data.
Data is words, numbers, and facts.
The "larger
view" of a computer is to transform data into information, that is, to
organize the words, numbers, and facts to be useful and productive.
Therefore, think of a computer as being a set of processes that handle
data.

The following chart describes the parts of a computer as
both hardware and processes for dealing with data:
|
Component
|
Hardware
|
Process
|
|
Input
|
A device that brings data into the computer.
For example: keyboard, mouse, network, and modem.
|
The collection of data from a user into
the computer.
For example: entering your name, address, and phone number into an
application.
|
|
Output
|
A device that presents data and or information to the end user.
For example: monitor, printer, network, or modem.
|
The presentation (or transmission) of
information to the end user.
For example: displaying or printing a database report.
|
|
Memory
|
A means to store data for short- or long-term use.
For example: long-term - hard disk, floppy disk, CD-ROM;
short-term— random access memory (RAM).
|
Storing and managing data from input,
for output, and for processing.
Data is stored for short-term manipulation or for long-term reuse.
For example, when data is input, it is stored as a record in a
database file.
|
|
Processor
|
A device for executing programmed instructions.
This is the central processing unit
(CPU) of a computer.
|
Manipulation of data to accomplish
specific tasks.
For example: sorting financial records and summing the total costs
on a daily basis.
|
|
Control
|
The program or instructions used to operate a computer.
This includes the programs (on-disk) for the operating system and
application software such as a word processor.
|
The set
of steps to
accomplish tasks
by the computer.
|
The following is a block diagram of a single-processor
computer architecture:
Programming enables
you to control the operation of a computer - to input, process, memorize
(store), and output information.
Programming is
accomplished by using standardized sets of commands or instructions that the
computer can follow or "execute."
Examples of instructions include:
 |
Input <data from a file or keyboard> |
 |
Print <to a file or printer> |
 |
If <condition> Then <do this> |
 |
Add <two numbers> |
 |
Quit <the current
program> |
|