Comp Sci Ch. 3 Flashcards

0
Q

What do software requirements do?

A

Tell what a program is supposed to do

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

What are the 4 steps of program development?

A

Establishing requirements, creating a design, implementing the code, and testing the implementation

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

What is software design?

A

The central planning of a program

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

What is pseudo code?

A

The outline of a program

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

What is impememtation?

A

The least creative step. Translating the design into source code

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

What is testing?

A

Running the code to fix errors with multiple inputs

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

in what way is a program executed?

A

Linear unless specified otherwise

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

What is the order in which a program is executed called?

A

Flow of control

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

How are conditional statements tested?

A

Booleans

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

What is executed with multiple if/ else if statements?

A

Just one of the statements

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

What is a block statement?

A

The text between the brackets in a method or condition

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

How do you format code in eclipse?

A

Highlight it, then hit control-L

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

What is implementation like?

A

Actually doing something

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

What does an if else statement do?

A

Catch anything that doesn’t go into the if statement

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

What is a block statement?

A

Everything between braces

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

What does the ! Do?

A

Negate a statement

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

What is discrete math?

A

Logical stuff like statements

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

What does a carrot mean?

A

And

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

What does an upside down carrot mean?

A

Or

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

What is XOR?

A

One is true so the whole thing is

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

When is an implication false?

A

When P is true but Q isn’t

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

What do letters represent?

A

Statements that can be true or false

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

This is a complete proposition/statement that is always true

A

Tautology

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

This is a statement that is always false

A

Contradiction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
This is something that is not a tautology or a contradiction
Contingency
25
What is something always tested to be?
True
26
What does || mean?
Or
27
What does && mean?
And
28
What does != mean?
Not equal
29
What is a binary operator?
A thing that uses 2 operands
30
What is a logical not operation aka as?
Logical negation/logical compliment
31
What has a higher precedence: logical not or and/or?
Not
32
What is a short circuited operator?
If part of the logical and/or is true, it stops right away
33
How can you compare characters?
Their location in the alphabet
34
How is unicode ordered?
Punctuation, uppercase alphabetical, lowercase alphabetical
35
Why can't you use == when comparing strings?
THey have their own, compareTo method
36
What is lexiographic ordering?
The same Unicode ordering, with shorter phrases before longer ones, like "book" before "bookshelf"
37
Why don't you use == with floats?
Because it must be equal and not close
38
What is a good way to compare decimals?
if (Math.abs(thing1-thing2)<0.000001)
39
What is an increment?
"++" ex. count++ is really count+1
40
What is a decrement?
"--" ex. count-- is really count-1
41
What would num+=count be?
Num=num+count
42
Can a string use increments and decrements?
Yes
43
What does a repetition statement allow us to do?
Run a statement multiple times
44
WHat are the common means of repetition statements?
While and FOr loops
45
Is while or for more efficient?
For
46
What happens if a while loop's condition is initially false?
It is never executed
47
What is a sentinel value?
The last input
48
What is input validation?
Testing to see if something put into java makes sense
49
What must be done in a while loop to prevent an infinite loop?
Something that will eventually make it false
50
What kind of an error is an infinite loop?
Logical
51
What does an iterator do?
Read inputs from a file and process all of them at once
52
What are the iterator methods?
.Next and .hasNext
53
What does IO mean?
Input/output
54
What is an exception?
When things go other than what was intended
55
When is a while loop useful?
When we have no clue how many times something is going to run
56
When is a for loop useful?
When we know exactly how many times a loop is going to run
57
What is a for loop initialization?
SOmething that is executed before the loop runs
58
What is a for loop condition?
The statement being tested
59
What is a for loop incrament?
The thing that is executed every time a loop is run
60
Is it necessary that a loop is executed?
No
61
What must you do to exclude parts of the for statement?
Separate the parts you are using with semicolons
62
When would you leave initialization blank?
When you have already defined a variable
63
What does the forEach loop do?
Process something like an iterator