Professional Documents
Culture Documents
CHAPTER I
Programming - Giving a mechanism the directions to
accomplish a task.
Programmers - The people who write programs.
Coding - The process of translating the solution.
Machine Language or Machine Code - Instructions
written in 0s and 1s.
Assembly Languages - simplify the programmer’s job by
allowing the programmer to use mnemonics in place of
the 0s and 1s in the program. Programs written in an
assembly language require an assembler.
Mnemonics - Memory Aids—in this case, alphabetic
abbreviations for instructions.
High-level languages - a vast improvement over machine
and assembly languages, because they allow the
programmer to use instructions that more closely
resemble the English language.
Compiler - translates all of a program’s high-level
instructions before running the program.
Interpreter - translates the instructions line by line as the
program is running.
Procedure-Oriented Program - the programmer
concentrates on the major tasks that the program needs
to perform. Ex. payroll program
Object-Oriented Program - requires the programmer to
focus on the objects that the program can use to
accomplish its goal. Ex. programs written for the
Windows environment typically use objects such as
check boxes, list boxes, and buttons
Control Structures or Logic Structures - All computer
programs, no matter how simple or how complex, are
written using one or more of three basic structures:
sequence, selection, and repetition.
Sequence Structure - a computer program directs the
computer to process the program instructions, one after
another, in the order listed in the program.
Algorithm - a set of step-by-step instructions that
accomplish a task.
Selection Structure or Selection Structure - indicates
that a decision (based on some condition) needs to be
made, followed by an appropriate action derived from
that decision.
Repetition Structure - directs the computer to repeat
one or more instructions until some condition is met, at
which time the computer should stop repeating the
instructions. Th e repetition structure also is referred to
as a loop or as iteration.
01000101 01001010
Computer Programming (CS 111)
Identifiers
- a sequence of one or more letters, digits or
underscore characters (_). Neither spaces nor Operators - mostly made of signs that are not part of the
punctuation marks or symbols can be part of an alphabet but are available in all keyboards.
identifier Assignment (=) - assigns a value to a variable.
Fundamental Data Types Arithmetic operators
01000101 01001010
Computer Programming (CS 111)
Compound assignment The while loop - to repeat statement while the condition
set in expression is true.
The do-while loop - exactly the same as the while loop,
except that condition in the do-while loop is evaluated
after the execution of statement instead of before,
granting at least one execution of statement even if
condition is never fulfilled.
Increase and decrease
The for loop - to repeat statement while condition
remains true. But in addition, the for loop provides
specific locations to contain an initialization statement
and an increase statement.
Relational and equality operators
01000101 01001010
Computer Programming (CS 111)
01000101 01001010