Unit One Flashcards

1
Q

What is “bit” and acronym for?

A

Binary Digit

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

How many bits in a byte?

A

8

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

What does ASCII stand for?

A

American Standard Code for Information Interchange

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

What are the two categories of translation programs?

A

Interpreter & Compiler

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

What is object code?

A

Machine Language

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

How does an interpreter program translate code?

A

Line by line, translating then executing.

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

How does a compiler program translate code?

A

Translates entire source code.

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

Does a compiler execute code?

A

No

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

What kind of code does Java compile to?

A

Byte code

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

Which is faster, compiler or interpreter?

A

Compiler

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

What are the two main programming paradigms?

A

Procedural & Object Oriented

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

What is the difference between procedural and object oriented programming?

A

How you analyze a problem

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

Breaking down a process into atomic tasks

A

Task Analyses or Decomposition

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

What is an Algorithm?

A

A procedure or series of steps for solving a problem

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

What are the two components of an algorithm?

A

What are the tasks, what order are they to be done

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

What was the software crisis?

A

’60s programming was costly and inefficient due to a lack of cohesive standards

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

What was a major coding component of the Software Crisis?

A

GOTO statements leading to “spaghetti code”

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

What are the 3 control structures necessary for any program?

A

1) Sequence
2) Selection (conditional “IF” “THEN”)
3) Repetition (looping)

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

What is an “Object” in programming?

A

Some computer code that models a self contained entity in the real world

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

What two things comprise an object?

A

Data (Variables) and Actions (Methods)

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

What programming language is Java based on?

A

C++

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

What is the Java compiler called?

A

javac.exe

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

What makes Byte Code unique?

A

It cannot run on any CPU

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

What is the JVM?

A

Java Virtual Machine, software that interprets Byte code

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

Where is data that has been typed stored?

A

The Keyboard Buffer

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

What is the Java API?

A

Application Programmer Interface, holds thousands of useful classes in “packages” or class libraries

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

To access a package from the API, what must you do?

A

Import the package with an import statement

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

How do you perform a manual flush of the keyboard buffer?

A

input.nextLine( );

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

What operations require a manual buffer flush? (3)

A

next( );
nextInt( );
nextDouble( );

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

What is the character at the end of typing called?

A

End of Line character
New Line character
Carriage Return

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

What is a variable?

A

A storage location in the computer’s memory, or RAM.

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

What two things must a variable have?

A

1) A name

2) A data type

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

What are three other ways to say variable name?

A

1) Identifier
2) Reference
3) Handle

34
Q

To create a variable, you must _______ it.

A

Declare

35
Q

What are we doing when we declare a variable?

A

Binding to a memory address

36
Q

What can a variable name NOT start with?

A

A number

37
Q

What CAN a variable name start with?

A
A letter (A,a)
A dollar sign ($)
An underscore (_)
38
Q

What words can’t be variable names?

A

Java Reserved Words

39
Q

Why do we specify data types when declaring a variable?

A

It tells the computer how many bytes of memory to allocate the variable

40
Q

ASCII and UNICODE share ___ characters.

A

256, or 2^8

41
Q

What are the two data types?

A

1) Primitive

2) Object

42
Q

What is the difference between primitive and object data types?

A

Primitive have no method associated with them.

43
Q

How many primitive data types are there?

A

8
6 Numeric
2 Non-numeric

44
Q

What are the 6 numeric primitive data types?

A
Byte
Short
Int
Long 
Float 
Double
45
Q

How may bits in a “short” data type?

A

16 bits, or 2 bytes

46
Q

How many bits in an “int” data type?

A

32 bits, or 4 bytes

47
Q

How many bits in a “long” data type?

A

64 bits, or 8 bytes

48
Q

How many bits in a “float” data type?

A

32 bits, or 4 bytes

49
Q

How many bits in a “double” data type?

A

64 bits, or 8 bytes

50
Q

What are the 2 default numeric data types?

A

Int and Double

51
Q

How many bits in a “char” data type?

A

16 bits, or 2 bytes

52
Q

How many bits in a “boolean” data type?

A

1 bit

53
Q

How is floating data stored?

A

As a mantissa and an exponent

54
Q

What is the naming convention for constants?

A

UPPER_CASE_LETTERS

55
Q

What keyword is used to declare a constant?

A

final

56
Q

What is a String?

A

A sequence of characters

57
Q

What is a string literal?

A

Surrounding a String of characters with quotation marks (“ “)

58
Q

What kind of operators are “+, -, *, /, and %” and why?

A

Binary operators, because they appear between two operands.

59
Q

What is a unary operator?

A

”+, -“ do denote positive and negative.

60
Q

What is the increment operator?

A

++

61
Q

What is “–” called?

A

The decrement operator

62
Q

For increment operations, which type is most common?

A

Post-increment

63
Q

What is type casting?

A

Converting a value of one data type into a value of another data type.

64
Q

if Statements are ______-selection type.

A

Single

65
Q

What type of statement is an “if-else”?

A

Double-selection type.

66
Q

How do you get a “true” result from an && operation?

A

Both conditions bust be true.

67
Q

How do you get a “false” result from an || operation?

A

Both conditions must be false.

68
Q

Why do we use the double “&&, ||” when the single will do?

A

Single “&” is the bitwise operator, and both sides will be evaluated regardless of first result.

69
Q

What is the “!” operator?

A

The “NOT” operator.

70
Q

What are some other names for the XOR operator?

A

EXCLUSIVE OR, Bitwise Comparison Operator

71
Q

What is the symbol for XOR?

A
72
Q

What does the XOR compare?

A

Boolean values, only returning TRUE if they are DIFFERENT.

73
Q

Can a switch statement evaluate a floating data type?

A

No

74
Q

A switch can only test for ________.

A

Equality “==”

75
Q

What unique character is used in switch statements?

A

The colon, “:”

76
Q

What is the syntax for the ternary operator?

A

condition ? value if true : value if false

77
Q

What are the three types of programming errors?

A

1) Syntax Error
2) Runtime Error
3) Logic Error

78
Q

Which type of error stops code from compiling?

A

Syntax error

79
Q

Which type of error gives the wrong result?

A

Logic error

80
Q

Which type of error lets the program compile, but stops it from executing?

A

Runtime error