• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/56

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

56 Cards in this Set

  • Front
  • Back
What is the syntax of a program language?
The grammar rules of the language. Program will not compile if these rules are violated.
What are the semantics of a language?
The actual meaning of the instructions in the programming language. Compiler cannot find these errors -- logic errors
What is a function?
A function is a collection of statements that when executed accomplishes somethign.
What function must all C++ programs contain?
The "main" function.
What is a comment?
Comments are non executable statements that are included in a program to provide info about what the program does, how it works, etc.
How are comments formatted?
Two ways:
After two forward slashes:
// THIS IS A COMMENT
or between /* and */.
What are identifiers?
Names of things that are used in a program such as variables, constants, and functions.
What are the rules for naming legal identifiers?
1) No reserved words can be used as identifiers
2) First character must be a letter or underscore
3) Remaining characters must be letters, digits, or underscores
What is a program?
A sequence of statements whose objective is to accomplish a task
What is a programming language?
a set of rules, symbols, and special words
What is the syntax of a program language?
The grammar rules of the language. Program will not compile if these rules are violated.
What are the semantics of a language?
The actual meaning of the instructions in the programming language. Compiler cannot find these errors -- logic errors
What is a function?
A function is a collection of statements that when executed accomplishes somethign.
What function must all C++ programs contain?
The "main" function.
What is a comment?
Comments are non executable statements that are included in a program to provide info about what the program does, how it works, etc.
How are comments formatted?
Two ways:
After two forward slashes:
// THIS IS A COMMENT
or between /* and */.
What are identifiers?
Names of things that are used in a program such as variables, constants, and functions.
What are the rules for naming legal identifiers?
1) No reserved words can be used as identifiers
2) First character must be a letter or underscore
3) Remaining characters must be letters, digits, or underscores
What is a program?
A sequence of statements whose objective is to accomplish a task
What is a programming language?
a set of rules, symbols, and special words
What are reserved words?
AKA Keywords.
Words that are used for special purposes in a program and cannot be redefined.
What are some reserved words?
int, namespace, include, using, return, float, double, char, const,
What is a data type?
A data type is a set of values together with a set of operations.
What are some C++ data types?
int, char, float, double, bool
What is the int data type?
Data types that deal with integers, numbers without a decimal.
What are floating-point data types?
Data types that refer to numbers with decimals and include float, and double.
What is the difference between float and double?
Float represents numbers between -3.4E38 and 3.4E38 and allocates four bytes of memory. Double represents numbers between -1.7E308 and 1.7E308 and allocates eight bytes of memory.
What is the char data type?
Char values include single letters, digits, and special symbols. Can only represent a single character at a time. (Values are enclosed in single quotes ' ')
How are char values organized?
They are organized in a collating sequence -- grouped together in ascending order. The most common char data set is the ASCII (American Standard Code for Information Interchange) and has 128 values.
What is an arithmetic expression?
A sequence of operands (numbers in an expression) and operators (+,-,*,/,%) that describe a calculation to be performed.
What is a unary operator?
An operator that has only one operand.
What is a binary operator?
An operator that has two operands.
What are like-type expressions?
Expressions in which all operands have the same data type (int, float, or double). The result will have the same data type of the operands.
Integral division
/ with the integral data type yields the quotient in ordinary division; it truncates any fractional part so the result is a whole number
% Modulus
Can only be used with int values. Used to find the remainder of integer division and the result will ALWAYS be an integer.
What is a mixed expression?
An expression that has operands with different data types.
How are mixed expressions evaluated?
If operands have same data type, operations performed result in matching type of operands. If operands have different data types, type coercion will occur and result will be of the higher type.
What is type coercion?
When a value of one data type is implicitly (automatically) changed to another data type.
What is type casting (static_cast)?
When a programmer explicitly indicates that a value is to be converted to another type:
static_cast<datatypename>(expression)
What is a variable?
A memory location with a name and data type whose contents may be changed during program execution.
What is the syntax for variable declaration?
datatype identifier;
datatype identifier, identifier,...;
datatype identifier = value;
Where should variable declarations be placed?
Generally, at the start of a function. (Right after the function main is stated)
What is a named constant?
A memory location with a name and data type and a value, its content (value) CANNOT be changed during program execution.
What is the syntax for named constant declaration?
const datatype identifier = value;
Where should named constant declarations be placed?
Before start of main function.
What does the assignment statement do?
It allows programmers to store a value in a variable. It is used to change the value of a variable AFTER that variable has been declared.
What is the syntax for an assignment statement?
variable = expression;
A variable is said to be INITIALIZED the first time a value is placed in the variable.
What is an output statement?
It is used in a program to display results to the default output device (monitor).
What is the syntax of an output statement?
cout << expression << expression...;
What is a manipulator?
A statement used to format output.
What does endl do?
endl is a manipulator that causes the insertion point to move to the beginning of the next line (same as /n)
What is an input (read) statement?
A statement that is used to accept values from an external source.
What is the syntax of a read statement?
cin >> variable >> variable...;
What is << called?
steam insertion operator
What is >> called?
steam extraction operator
What is a prompt?
A message displayed to the screen asking user for input; generated with an output statement.