Kapitel 1 Flashcards

0
Q

Iist the five major hardware components of a computer system.

A

The Central Processing Unit (CPU), main memory, secondary storage devices, input devices, output devices.

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

Why is the computer used by so many different people, in so many different professions?

A

Because the computer can be programmed to do so many different tasks.

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

Internally, the CPU consists of what two units?

A

Arithmetic and Logic Unit (ALU), and Control Unit.

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

Describe the steps in the fetch/decode/execute cycle.

A

Fetch: The CPU’s control unit fetches the program’s next instruction from main memory.

Decode: The control unit decodes the instruction, which is encoded in the form of a number. An electrical signal is generated.

Execute: The signal is routed to the appropriate component of the computer, which causes a device to perform an operation.

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

What is a memory address? What is its purpose?

A

A unique number assigned to each section of memory. The address is used to identify a location in memory.

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

Explain why computers have both main memory and secondary storage.

A

Program instructions and data are stored in main memory while the program is operating. Main memory is volatile, and loses its contents when power is removed from the computer. Secondary storage holds data for long periods of time—even when there is no power to the computer.

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

What does the term multitasking mean?

A

It means that an operating system is capable of running multiple programs at once.

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

Describe the difference between a key word and a programmer-defined symbol.

A

A key word has a special purpose, and is defined as part of a programming language. A programmer-defined symbol is a word or name defined by the programmer.

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

Describe the difference between operators and punctuation symbols.

A

Operators perform operations on one or more operands. Punctuation symbols mark the beginning or ending of a statement, or separates items in a list.

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

Describe the difference between a program line and a statement.

A

A line is a single line as it appears in the body of a program. A statement is a complete instruction that causes the computer to perform an action.

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

Why are variables called “variable”?

A

Because their contents may be changed.

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

What happens to a variable’s current contents when a new value is stored there?

A

The original value is overwritten.

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

What is a compiler?

A

A compiler is a program that translates source code into an executable form.

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

What is a syntax error?

A

Syntax errors are mistakes that the programmer has made that violate the rules of the programming language. These errors must be corrected before the compiler can translate the source code.

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

What is byte code?

A

The Java compiler translates Java source code into byte code, which is an interme­diate language. The Java Virtual Machine executes the byte code instructions.

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

What is the JVM?

A

The Java Virtual Machine (JVM) is a program that reads Java byte code instructions and executes them as they are read. In other words, it interprets byte code instruc­tions. You can think of the JVM as a program that simulates a computer whose machine language is Java byte code.

16
Q

What four items should you identify when defining what a program is to do?

A

The program’s purpose, input, process, and output.

17
Q

What does it mean to “visualize a program running”? What is the value of such an activity?

A

Before you create a program on the computer, it is often a good idea to imagine what the computer screen will look like while the program is running. If it helps, draw pictures of the screen, with sample input and output, at various points in the program.

18
Q

What is pseudocode?

A

A cross between human language and a programming language. Pseudocode is especially helpful when designing an algorithm. Although the computer can’t understand pseudocode, programmers often find it helpful to write an algorithm in a language that’s “almost” a programming language, but still very similar to natural language.

19
Q

Describe what a compiler does with a program’s source code.

A

A compiler translates source code into an executable form.

20
Q

What is a runtime error?

A

A runtime error is an error that occurs while the program is running. These are usually logical errors, such as mathematical mistakes.

21
Q

Is a syntax error (such as misspelling a key word) found by the compiler or when the program is running?

A

Syntax errors are found by the compiler.

22
Q

What is the purpose of testing a program with sample data or input?

A

You can provide sample data and predict what the output should be. If the program does not produce the correct output, a logical error is present in the program.

23
Q

In procedural programming, what two parts of a program arc typically separated?

A

Data and the code that operates on the data.

24
Q

What are an object’s attributes?

A

The data contained in an object.

25
Q

What are an object’s methods?

A

The procedures, or behaviors, that an object performs.

26
Q

What it encapsulation?

A

Encapsulation refers to the combining of data and code into a single object.

27
Q

What is data hiding?

A

Data hiding refers to an object’s ability to hide its data from code that is outside the object. Only the object’s methods may then directly access and make changes to the object’s data. An object typically hides its data, but allows outside code to access the methods that operate on the data.