Intro to C++ Flashcards

(66 cards)

1
Q

the process of implementing the algorithm using a language the computer can understand.

A

Computer programming

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

a set of special words, symbols and rules for constructing a program.

A

Programming language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

There are many programming languages each with ____________________________________.

A

their own set of rules.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

used in C++ to name things.

A

Identifiers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

3 types of identifiers

A
  • Letters (LOWERCASE/UPPERCASE)
  • DIGITS (0-9)
  • THE UNDERSCORE ( _ ) CHARACTER
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

: C++ is ______________, In other words, uppercase and lowercase letters are considered to be different.

A

case-sensitive

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A set of valid data values along with the operations that may be performed on those values.

A

Data types

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

one alphanumeric character enclosed in single quotes.

A

char

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

positive or negative integers with or without a sign.

A

𝑖𝑛𝑡

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

positive or negative numbers containing an integer part and a fractional part with a decimal point in between.

A

float/ double

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

an set of characters used to hold data containing more than one character enclosed in double quotes.

A

string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

true of false

A

bool

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Assignment statement

A

Syntax: variable = expressions;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

information of the program needs (a list of all necessary header files used in the program).

A

Preprossesor directives

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

functions by definition return a value

A

Heading

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Heading

A

– int main ( )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

{
variable declarations and
executable statements
}

A

Main function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

FORMAT:

A

include<iostream></iostream>

using namespace std;

int main ( )
{
	//Executable Statements
				⋮
	return 0;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

a predefined variable in C++ that indicates you are going to output a stream of characters to an output device.

A

𝑐𝑜𝑢𝑡

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

GENERAL FORM OF COUT:

A

cout&laquo_space;ExprOrString &laquo_space;ExprOrString … ;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

causes the cursor to move to the beginning of the next line. This is one way to get blank lines in your output.

A

𝑒𝑛𝑑𝑙 (end line)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

is a predefined variable in C++ that indicates you are going to input a stream of characters from an input device

A

cin

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

GENERAL FORM OF CIN:

A

cin&raquo_space; variable1&raquo_space; variable2 … ;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

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 _______________________

A

names of one or more variables.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
made up of constants, variables, operators and parentheses.
Arithmetic expressions
26
The arithmetic operators in C++ are
+ (addition) - (subtraction) * (multiplication) / (division) % (modulus - the remainder from integer division)
27
When expressions are evaluated, they are evaluated ______________.
left to right
28
following precedence rules:
( ) * / % + -
29
Logical operators
and ( & ) or ( | ) not ( ! ) xor ( ^ )
30
Shifting operators
Shift left (≪) Shift right (≫)
31
relational operators
equal ( == ) not equal ( != ) less than ( < ) greater than ( > ) less than or equal ( <= ) greater than or equal ( >= ) logical and (& &) logical or ( || )
32
allows operators to be combined for a short-hand notation.
combined operators
33
combined operators
+= add and equal −= subtract and equal ∗= multiply and equal /= divide and equal %= modulo and equal &= and equal |= or equal ^= xor equal
34
provides increment and decrement operators.
increment and decrement
35
increment/decrement the contents of n and use the new value of n in the expression.
++n or --n
36
use the current value of n in the expression and when finished, increment/decrement n.
N++ or n--
37
+
(addition)
38
-
(subtraction)
39
*
(multiplication)
40
/
(division)
41
%
(modulus - the remainder from integer division)
42
The % operator may appear ONLY with ______________
integer values.
43
( & )
and
44
( | )
or
45
( ! )
not
46
( ^ )
xor
47
(≪)
Shift left
48
(≫)
Shift right
49
( == )
equal
50
( != )
not equal
51
( < )
less than
52
( > )
greater than
53
( <= )
less than or equal
54
( >= )
greater than or equal
55
(& &)
logical and
56
( || )
logical or
57
+=
add and equal
58
−=
subtract and equal
59
∗=
multiply and equal
60
/=
divide and equal
61
%=
modulo and equal
62
&=
and equal
63
|=
or equal
64
^=
xor equal
65
++
increment
66
--
decrement