program
set of instructions that a computer follows to perform a task
software
what programs are referred to as
programmer/software developer
a person with the skills necessary to design, creat, and test computer programs
Hardware
the physical components of a computer
Central Processing Unit
part of the computer that runs programs or software
microprocessors
tiny chips that are used as CPUs today
control unit
one of two parts of the CPU, coordinates all of the computer’s operations
logic unit (ALU)
one of two parts of CPU, designed to perform mathematical operations
Fetch
the CPU’s control unit fetches the next instruction in order from the main memory
Decode
The instruction is encoded as a number, the control unit decodes the instructions
Execute
the signal is routed to a component and the signal causes the component to perform an operation
Random Access Memory (RAM)
main memory, where the computer stores a program while it is running, usually volatile
Volatile Memory
only used for temporary storage while a program is running
bytes
what a computer’s memory is divided into
Bit
each byte is divided into 8 bits, standing for binary digit
Secondary Storage
type of memory that can hold data for long periods of time, where programs are usually stored
disk drive, solid-state drives
common secondary storage devices
memory cards, USB
external storage devices
CD, DVD
optical devices that are popular for data storage
Input
any data the computer receives from the outside world
input device
device that collects the information and sends it to the computer, keyboards, mouse, touch screen, scanner
Output
any information the computer sends to the outside world
Output Device
formats and presents output, computer screens, printers, speakers
Operating system
the most fundamental set of programs on a computer
Utility programs
performs a specialized task that enhances the computer’s operation data
Software development tools
the tools programmers use to creat, modify, and test software
application software
programs that make a computer useful for everyday tasks
Algorithm
set of well-defined steps for performing a task or solving a problem
machine language
sequence of binary numbers which the CPU interprets as commands
Programming languages
use words instead of numbers to program
low-level language
close to the level of the computer, resembles numeric language
high-level language
easiest language for people to understand
portability
can be written on one computer and run on many other types of systems
text editor
similar to a word processing program, used to write code
source code
statements written by the programmer
source file
file the code is saved in
preprocessor
reads the source code and looks for #
directives
cause the preprocessor to amend or process the source code in some way
compiler
steps through the preprocessed source code translating the source code instructions into the appropriate machine language instruction
syntax errors
illegal uses of key words, operators, punctuation, and other language elements
object code
translated machine language instructions
object file
where the object code is stored
run-time library
collection of code in C++ that contains hardware-specific code
linker
combines the object file with the necessary library routines
executable file
contains the machine language instructions and is ready to run on the computer
executable code
machine language instructions
Key Words
words that have special meaning and can only be used for their intended purpose
Programmer-Defined identifiers
words defined by the programmer
operators
perform operations on one or more operand
punctuation
mark the beginning or end of a statement or separate items in a list
Syntax
rules that must be followed when constructing a program
line
a single line as it appears in the body of a program
statement
complete instruction that causes the computer to perform some action
variable
a named storage location in the computer’s memory for holding a piece of data
variable definition
the type of variable along with its name
three-step process
gathering input, performing some process, producing output
top-down design
dividing your problems into small problems and solving them one by one
flowchart
a diagram that shows the logical flor of a program
Pseudocode
cross between human language and a programming language
Logic errors
mistakes that cause a program to produce incorrect results
desk-checking
the programmer starts reading the program and steps through each statement by hand
function
group of one or more programming statements that has a name
stream object
works with streams of data
stream-insertion operator
the item is inserted into the output stream
escape sequence
a backslash followed by a control character, used to control the way output is displayed
assignment statement
assigns a value to a variable
assignment operator
=
literal
a piece of data written directly into a program’s code
identifier
a programmer-defined name that represents some element of a program
Legal Identifiers
the first character must be A-Z, after that any letter, numbers or underscore can be used
short int
2 bytes
unsigned short int
2 bytes, positive only
int
4 bytes
unsigned int
4 bytes, positive only
long int
4 bytes
unsigned long int
4 bytes, positive only
long long int
8 bytes
unsigned long long int
8 bytes, positive only
float
4 bytes, single precision
double
8 bytes, double precision
long double
8 bytes, long double precision
null character or null terminator
marks the end of the string
boolean expressions
have a true or false value
true
1
false
0
scope
the part of the program a variable can be used
Unary operators
only require a single operand (-5)
negation operator
the minus sign when used in front of a number
binary operators
work with two operands
Ternary operators
require three operands
prompt
lets the user know that an input is expected
stream extraction operator
extras characters from the input stream so they can be used in the program
input/keyboard buffer
an area in memory where characters from the keyboard are temporarily placed
arguments
information being sent to a function
relational expression
expressions comparing two values
decision structure
allow statements to execute only under certain circumstances
conditionally executred
performed only when a certain condition exists
nested if
allows you to test more than one condition to determine which block of code should be executed
loop
control structure that causes a statement to repeat
pretest loop
tests its condition before each iteration