Programming Logic and Design Seventh Edition
Programming Logic and Design Seventh Edition
Programming Logic and Design Seventh Edition
Seventh Edition
Chapter 1
An Overview of Computers and
Programming
Objectives
In this chapter, you will learn about:
Computer systems
Simple program logic
The steps involved in the program development cycle
Pseudocode statements and flowchart symbols
Using a sentinel value to end a program
Programming and user environments
The evolution of programming models
Hardware
Equipment associated with a computer
Software
System & Application
Computer instructions that tell the hardware what to do
Programs
Software written in a language to perform a particular task
Input
Data items enter computer
Process
By central processing unit (CPU)
Output
Store
Syntax
Rules governing the construction of valid statements in a language [
keywords, operators, identifiers, punctuation ]
Conventions
Translator
Compiler and/or an interpreter
Translates program code into machine language (binary language)
Checks for syntax errors
Many modern languages use both a compiler and an interpreter
Documentation
Supporting paperwork for a program
flowchart / pseudocode
hierarchy chart (aka structure chart or VTOC)
screen / printer spacing chart
end user instructions
Desk-checking
Walking through a programs logic on paper before you
actually write the program
Translator program
Compiler and/or interpreter
Changes the programmers English-like high-level programming
language into the low-level machine language
Syntax error
Misuse of a languages grammar rules
Programmer corrects listed syntax errors
Might need to recompile the code several times
misspelled variable names
unmatched curly braces
Run-time error
program ends abnormally when the user runs the program
(sometimes or every time)
Test Data
Execute the program with some sample test data to see
whether the results are logically correct
Programming Logic & Design, Seventh Edition 16
Deploy the Program
Make the Program Available for Use
Process depends on programs purpose
May take several months
Conversion
Entire set of actions an organization must take to switch
over to using a new program or set of programs
Pseudocode
English-like representation of the logical steps it takes to
solve a problem
Flowchart
Pictorial representation of the logical steps it takes to solve
a problem
start
input myNumber
set myAnswer = myNumber * 2
output myAnswer
stop
English-like
Input symbol
Indicates input operation
Parallelogram
Processing symbol
Processing statements such as arithmetic
Rectangle
Connector symbol
Used to connect flowlines
small circle
Flowlines
Lines and Arrows that connect steps
Terminal symbols
Start/stop symbols
Shaped like a racetrack
Also called lozenge or capsule
Programming Logic & Design, Seventh Edition 23
Drawing Flowcharts (continued)
Infinite loop
Repeating flow of logic with no end (repeat forever)
Making a decision
Testing a value
Decision symbol
Diamond shape
Dummy value
Data-entry value that the user will never need
Sentinel value
eof (end of file)
Marker at the end of a file that automatically acts as a
sentinel