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
Where is data that has been typed stored?
The Keyboard Buffer
26
What is the Java API?
Application Programmer Interface, holds thousands of useful classes in "packages" or class libraries
27
To access a package from the API, what must you do?
Import the package with an import statement
28
How do you perform a manual flush of the keyboard buffer?
input.nextLine( );
29
What operations require a manual buffer flush? (3)
next( ); nextInt( ); nextDouble( );
30
What is the character at the end of typing called?
End of Line character New Line character Carriage Return
31
What is a variable?
A storage location in the computer's memory, or RAM.
32
What two things must a variable have?
1) A name | 2) A data type
33
What are three other ways to say variable name?
1) Identifier 2) Reference 3) Handle
34
To create a variable, you must _______ it.
Declare
35
What are we doing when we declare a variable?
Binding to a memory address
36
What can a variable name NOT start with?
A number
37
What CAN a variable name start with?
``` A letter (A,a) A dollar sign ($) An underscore (_) ```
38
What words can't be variable names?
Java Reserved Words
39
Why do we specify data types when declaring a variable?
It tells the computer how many bytes of memory to allocate the variable
40
ASCII and UNICODE share ___ characters.
256, or 2^8
41
What are the two data types?
1) Primitive | 2) Object
42
What is the difference between primitive and object data types?
Primitive have no method associated with them.
43
How many primitive data types are there?
8 6 Numeric 2 Non-numeric
44
What are the 6 numeric primitive data types?
``` Byte Short Int Long Float Double ```
45
How may bits in a "short" data type?
16 bits, or 2 bytes
46
How many bits in an "int" data type?
32 bits, or 4 bytes
47
How many bits in a "long" data type?
64 bits, or 8 bytes
48
How many bits in a "float" data type?
32 bits, or 4 bytes
49
How many bits in a "double" data type?
64 bits, or 8 bytes
50
What are the 2 default numeric data types?
Int and Double
51
How many bits in a "char" data type?
16 bits, or 2 bytes
52
How many bits in a "boolean" data type?
1 bit
53
How is floating data stored?
As a mantissa and an exponent
54
What is the naming convention for constants?
UPPER_CASE_LETTERS
55
What keyword is used to declare a constant?
final
56
What is a String?
A sequence of characters
57
What is a string literal?
Surrounding a String of characters with quotation marks (" ")
58
What kind of operators are "+, -, *, /, and %" and why?
Binary operators, because they appear between two operands.
59
What is a unary operator?
"+, -" do denote positive and negative.
60
What is the increment operator?
++
61
What is "--" called?
The decrement operator
62
For increment operations, which type is most common?
Post-increment
63
What is type casting?
Converting a value of one data type into a value of another data type.
64
if Statements are ______-selection type.
Single
65
What type of statement is an "if-else"?
Double-selection type.
66
How do you get a "true" result from an && operation?
Both conditions bust be true.
67
How do you get a "false" result from an || operation?
Both conditions must be false.
68
Why do we use the double "&&, ||" when the single will do?
Single "&" is the bitwise operator, and both sides will be evaluated regardless of first result.
69
What is the "!" operator?
The "NOT" operator.
70
What are some other names for the XOR operator?
EXCLUSIVE OR, Bitwise Comparison Operator
71
What is the symbol for XOR?
^
72
What does the XOR compare?
Boolean values, only returning TRUE if they are DIFFERENT.
73
Can a switch statement evaluate a floating data type?
No
74
A switch can only test for ________.
Equality "=="
75
What unique character is used in switch statements?
The colon, ":"
76
What is the syntax for the ternary operator?
condition ? value if true : value if false
77
What are the three types of programming errors?
1) Syntax Error 2) Runtime Error 3) Logic Error
78
Which type of error stops code from compiling?
Syntax error
79
Which type of error gives the wrong result?
Logic error
80
Which type of error lets the program compile, but stops it from executing?
Runtime error