exam 1 Flashcards

1
Q

algorithm

A

finite steps to solve a problem

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

three major errors in programming?

A

syntax, logical (= instead of ==), runtime (infinity loop)

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

program

A

implementation of an algorithm to solve a program

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

variable

A

name of the location of a memory

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

parts of a variable?

A

variable name and data type

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

smallest unit of memory

A

bit

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

byte = __ bits

A

byte = 8 bits

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

int has how many bytes?

A

int has 4 bytes

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

5 parts of a computer

A

CPU, main memory, input (keyboard, mouse, etc.), output (monitors, printers, etc.), secondary memory

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

compiler

A

converts program into machine level language so instructions can be read and executed by computer

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

statement

A

an instruction to be carried out by the computer

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

difference between do while and while loop

A

do while will execute at least once, while may not execute at all if conditions are false/unmet

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

use double when?

A

real numbers (1.3, 100.23, etc)

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

use int when?

A

integers (7, 16, etc.)

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

+, -, /, * for….

A

for integers or real numbers

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

% for…

A

for integers only NO DECIMALS

17
Q

use < c math > when….

A

when sqrt, pow

18
Q

use < c std lib > when….

A

when rand

19
Q

do while loop

A

do {
statements;
} while (condition);