BASIC ELEMENTS OF C++ Flashcards
A sequence of statements whose objective is to accomplish a task
Computer Program
The process of planning and creating a program
Programming
collection of statements
Subprogram or Function
rules that specify which statements (instructions) are legal or valid
Syntax rules
determine the meaning of the instructions
Semantic rules
a set of rules, symbols, and special words
Programming language
Two types of Comment Line
Single line and Multiple line
A single line begins with what symbol
//
Multiple line is enclosed with a symbol
/* and */
the smallest individual unit of a program written in any language
token
C++ tokens include
special symbols, word symbols, and identifiers
Special symbols in C++ include:
+ - * /
. ; ? ,
<= != == >=
Cannot be redefined within a program
Reserved word symbols or keywords
Cannot be used for anything other than their intended use
Reserved word symbols or keywords
Examples of Reserved Words
int
float
double
char
const
void
return
name of something that appears in a program
identifier
Consists of letters, digits, and the underscore character (_)
identifier
identifiers must begin with
a letter or underscore
TRUE OR FALSE
C++ is case sensitive
TRUE
TRUE OR FALSE
NUMBER is the same as number
FALSE
Two predefined identifiers
cout and cin
TRUE OR FALSE
Unlike reserved words, predefined identifiers may be redefined, but it is not a good idea
TRUE
3 Legal identifiers in C++
first
conversion
payRate
Include blanks, tabs, and newline characters
Whitespaces