1/28
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Simple Data Type
• Integral: integers (numbers without a decimal)
- Can be further categorized: char, short, int, long, bool, unsigned char, unsigned
short, unsigned int, unsigned long
• Floating-point: decimal numbers
• Enumeration: a user-defined data type
Variable
a memory location whose contents can be changed
String
A data type used to store a sequence of characters, such as letters, numbers, spaces, or symbols
Unary operator
An operator that works on one operand (one value or variable).
Binary operator
:An operator that works on two operands (two values or variables).
Prompt Line
executable statements that inform the user what to do
Syntax
The set of rules that determine how code must be written in a programming language so the computer can understand it.
Token
special symbols, word symbols, and identifier + - *
Mixed Arithmetic Expression
An arithmetic expression that contains different types of numbers, such as integers and decimal (double) values.
Precision
maximum number of significant digits
Number of digits in float?
Range: -3.4 1038 to 3.4
1038 (four bytes)
Number of digits in double?
Range: –1.7 10308 to 1.7
10308 (eight bytes
how many bytes of storage are allocated in int?
4
how many bytes of storage are allocated in float?
4
how many bytes of storage are allocated in double?
8
how many bytes of storage are allocated in char?
1
Maximum number of significant
digits (decimal places) for float
6 or 7
Maximum number of significant
digits for double
15
order of math operations in C++
Parentheses ( )
Unary operators +, -, ++, --
Multiplication, Division, Modulus *, /, %
Addition, Subtraction +, -
what results when using integer division
no round just one 1 so 1.5 is just 1 instead of 2
what results when using remainder operator
gives the reminder when dividing two numbers
what characters are allowed in an identifier name.
Letters: A–Z, a–z
Digits: 0–9
Underscore: _
what characters are consider whitespaces in C++.
pace
Tab \t
Newline \n
Carriage return \r
Form feed \f
Vertical tab \v
what symbol is called the “statement terminator”
;
how escape sequences are used in output
Special characters that begin with a backslash \ and are used to perform special actions in output.
what named constants are used for.
A constant value that is given a name so it can be used throughout a program without being changed.
hat comments are used for
Text written in a program to explain or document the code. They are ignored by the compiler and do not affect how the program runs.
what endl does in an output statement
Ends the current line of output and moves the cursor to the next line
how to use static_cast.
cout << static_cast<double>(a) / b;