Intro to C++ Flashcards

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
Q

made up of constants, variables, operators and parentheses.

A

Arithmetic expressions

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

The arithmetic operators in C++ are

A

+ (addition)
- (subtraction)
* (multiplication)
/ (division)
% (modulus - the remainder from integer division)

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

When expressions are evaluated, they are evaluated ______________.

A

left to right

28
Q

following precedence rules:

A

( )
* / %
+ -

29
Q

Logical operators

A

and ( & )
or ( | )
not ( ! )
xor ( ^ )

30
Q

Shifting operators

A

Shift left (≪)
Shift right (≫)

31
Q

relational operators

A

equal ( == )
not equal ( != )
less than ( < ) greater than ( > )
less than or equal ( <= )
greater than or equal ( >= )
logical and (& &)
logical or ( || )

32
Q

allows operators to be combined for a short-hand notation.

A

combined operators

33
Q

combined operators

A

+= add and equal
−= subtract and equal
∗= multiply and equal
/= divide and equal
%= modulo and equal
&= and equal
|= or equal
^= xor equal

34
Q

provides increment and decrement operators.

A

increment and decrement

35
Q

increment/decrement the contents of n and use the new value of n in the expression.

A

++n or –n

36
Q

use the current value of n in the expression and when finished, increment/decrement n.

A

N++ or n–

37
Q

+

A

(addition)

38
Q

-

A

(subtraction)

39
Q

*

A

(multiplication)

40
Q

/

A

(division)

41
Q

%

A

(modulus - the remainder from integer division)

42
Q

The % operator may appear ONLY with ______________

A

integer values.

43
Q

( & )

A

and

44
Q

( | )

A

or

45
Q

( ! )

A

not

46
Q

( ^ )

A

xor

47
Q

(≪)

A

Shift left

48
Q

(≫)

A

Shift right

49
Q

( == )

A

equal

50
Q

( != )

A

not equal

51
Q

( < )

A

less than

52
Q

( > )

A

greater than

53
Q

( <= )

A

less than or equal

54
Q

( >= )

A

greater than or equal

55
Q

(& &)

A

logical and

56
Q

( || )

A

logical or

57
Q

+=

A

add and equal

58
Q

−=

A

subtract and equal

59
Q

∗=

A

multiply and equal

60
Q

/=

A

divide and equal

61
Q

%=

A

modulo and equal

62
Q

&=

A

and equal

63
Q

|=

A

or equal

64
Q

^=

A

xor equal

65
Q

++

A

increment

66
Q

A

decrement