Intro to C++ Flashcards
the process of implementing the algorithm using a language the computer can understand.
Computer programming
a set of special words, symbols and rules for constructing a program.
Programming language
There are many programming languages each with ____________________________________.
their own set of rules.
used in C++ to name things.
Identifiers
3 types of identifiers
- Letters (LOWERCASE/UPPERCASE)
- DIGITS (0-9)
- THE UNDERSCORE ( _ ) CHARACTER
: C++ is ______________, In other words, uppercase and lowercase letters are considered to be different.
case-sensitive
A set of valid data values along with the operations that may be performed on those values.
Data types
one alphanumeric character enclosed in single quotes.
char
positive or negative integers with or without a sign.
𝑖𝑛𝑡
positive or negative numbers containing an integer part and a fractional part with a decimal point in between.
float/ double
an set of characters used to hold data containing more than one character enclosed in double quotes.
string
true of false
bool
Assignment statement
Syntax: variable = expressions;
information of the program needs (a list of all necessary header files used in the program).
Preprossesor directives
functions by definition return a value
Heading
Heading
– int main ( )
{
variable declarations and
executable statements
}
Main function
FORMAT:
include<iostream></iostream>
using namespace std; int main ( ) { //Executable Statements ⋮ return 0; }
a predefined variable in C++ that indicates you are going to output a stream of characters to an output device.
𝑐𝑜𝑢𝑡
GENERAL FORM OF COUT:
cout«_space;ExprOrString «_space;ExprOrString … ;
causes the cursor to move to the beginning of the next line. This is one way to get blank lines in your output.
𝑒𝑛𝑑𝑙 (end line)
is a predefined variable in C++ that indicates you are going to input a stream of characters from an input device
cin
GENERAL FORM OF CIN:
cin»_space; variable1»_space; variable2 … ;
Unlike the output statement which may contain constants, variables or more complicated expressions, the only items that may be specified in an input statement are the _______________________
names of one or more variables.
made up of constants, variables, operators and parentheses.
Arithmetic expressions
The arithmetic operators in C++ are
+ (addition)
- (subtraction)
* (multiplication)
/ (division)
% (modulus - the remainder from integer division)