CH 1,2,3 Flashcards
Design an algorithm to find the perimeter and area of a rectangle.
- Get the length of the rectangle.
- Get the width of the rectangle.
- Find the perimeter using the following equation:
perimeter = 2∙ (length + width) - Find the area using the following equation:
Area = length ∙ width
Design an algorithm to find the perimeter and area of a rectangle.
- Get the length of the rectangle.
- Get the width of the rectangle.
- Find the perimeter using the following equation:
perimeter = 2∙ (length + width) - Find the area using the following equation:
Area = length ∙ width
is an operator called the stream insertion/extraction operator.
which is a data type that deals with integers, or numbers without a decimal part.
Integral
which is a data type that deals with decimal numbers.
Floating-point,
Int values=
-2^31 to 2^31 storage 4 bytes
bool values=
true and false storage 1 byte
char values=
-2^7 to 2^7 storage 1 byte
long long values=
-2^63 to 2^63 storage 64 bytes
Double value-
-1.710^308 to 1.710^308 storage 8 bytes
Float value
-3.410^38 to 3.410^38 storage 4 bytes
Char-
data type, you enclose each character represented within single quotation marks.
Binary operator- EX.
an operator that has two operands. Ex. 3+4
Declaration statements- EX.
are used to declare things, such as variables. Ex. int a, b, c;
Executable statements- EX.
perform calculations, manipulate data, create output, accept input. Ex.a = 4; cin»_space; b; cout