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
Q

This is something that is not a tautology or a contradiction

A

Contingency

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

What is something always tested to be?

A

True

26
Q

What does || mean?

A

Or

27
Q

What does && mean?

A

And

28
Q

What does != mean?

A

Not equal

29
Q

What is a binary operator?

A

A thing that uses 2 operands

30
Q

What is a logical not operation aka as?

A

Logical negation/logical compliment

31
Q

What has a higher precedence: logical not or and/or?

A

Not

32
Q

What is a short circuited operator?

A

If part of the logical and/or is true, it stops right away

33
Q

How can you compare characters?

A

Their location in the alphabet

34
Q

How is unicode ordered?

A

Punctuation, uppercase alphabetical, lowercase alphabetical

35
Q

Why can’t you use == when comparing strings?

A

THey have their own, compareTo method

36
Q

What is lexiographic ordering?

A

The same Unicode ordering, with shorter phrases before longer ones, like “book” before “bookshelf”

37
Q

Why don’t you use == with floats?

A

Because it must be equal and not close

38
Q

What is a good way to compare decimals?

A

if (Math.abs(thing1-thing2)<0.000001)

39
Q

What is an increment?

A

”++” ex. count++ is really count+1

40
Q

What is a decrement?

A

”–” ex. count– is really count-1

41
Q

What would num+=count be?

A

Num=num+count

42
Q

Can a string use increments and decrements?

A

Yes

43
Q

What does a repetition statement allow us to do?

A

Run a statement multiple times

44
Q

WHat are the common means of repetition statements?

A

While and FOr loops

45
Q

Is while or for more efficient?

A

For

46
Q

What happens if a while loop’s condition is initially false?

A

It is never executed

47
Q

What is a sentinel value?

A

The last input

48
Q

What is input validation?

A

Testing to see if something put into java makes sense

49
Q

What must be done in a while loop to prevent an infinite loop?

A

Something that will eventually make it false

50
Q

What kind of an error is an infinite loop?

A

Logical

51
Q

What does an iterator do?

A

Read inputs from a file and process all of them at once

52
Q

What are the iterator methods?

A

.Next and .hasNext

53
Q

What does IO mean?

A

Input/output

54
Q

What is an exception?

A

When things go other than what was intended

55
Q

When is a while loop useful?

A

When we have no clue how many times something is going to run

56
Q

When is a for loop useful?

A

When we know exactly how many times a loop is going to run

57
Q

What is a for loop initialization?

A

SOmething that is executed before the loop runs

58
Q

What is a for loop condition?

A

The statement being tested

59
Q

What is a for loop incrament?

A

The thing that is executed every time a loop is run

60
Q

Is it necessary that a loop is executed?

A

No

61
Q

What must you do to exclude parts of the for statement?

A

Separate the parts you are using with semicolons

62
Q

When would you leave initialization blank?

A

When you have already defined a variable

63
Q

What does the forEach loop do?

A

Process something like an iterator