Module 1 Flashcards

1
Q

Program

A

Execution of instructions one at a time, sequentially.

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

CIN

A

[Characters in]- Reads user input until a whitespace is found

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

COUT

A

[Characters out] Outputs

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

Comments

A

Single line comments -> //

Multiple lines comments -> /* */

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

Variables

A

Named places in memory in which users store values

x = 5: assigns value 5 to variable x

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

Identifiers

A

Names which are chosen by the programmer:

  • Start with A-Z or _
  • Continue with A-Z, 1-9 or _
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Expression

A

A combination of values which evaluate to a value

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

Literal

A

A value in the code ( such as 20 or “Quit” )

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

Operators

A

Symbols which perform calculations on the data

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

Compound Operators

A

Symbols which simultaneously perform calculations and assign the value

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

Int vs Float

A

Int: used for items which are countable
Float: used for values coming from measurements

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

Scientific Notation

A
  • 1.5e9 = 1.5 * 10^9

- 1.5e-9 = 1.5 * 10^-9

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

Constant Variable

A

A variable which value is constant ant cant be changed after the assignment.
- const [type]varName;

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

Math Functions

A
  • pow(x , y): results in x^y
  • sqrt(x): results in the square root of x
  • fabs(x): results in |x|
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Division

A
  • int / int = int
  • int / float = float
  • n / 0 = Error
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Type conversions

A
  • Implicit type conversions are made by the compiler
  • Explicit type conversions can be made by coding:
    • type(value);
    • static_cast(value);
17
Q

Chars

A
  • Have to be declared using single quotes ( ‘ ‘ )

- Can only store one character which is stored with its corresponding encoding value.

18
Q

Escape Sequences

A
  • \n: Outputs a new line
  • \t: Outputs a tab
  • ' & ": Outputs single and double quotes
  • \ Outputs backslash
19
Q

Strings

A
  • # include
  • An ensemble of characters stored in a variable
  • Strings have to be enclosed in double-quotes ( “ “)
20
Q

Getline

A

Used to read user input until a newline is encountered

21
Q

Overflow

A

The situation in which the user is trying to store a value which exceeds the maximum bits amount.
All extra bits will be cut off from the result.