Chapter 01 Flashcards

1
Q

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

A

1.1 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

1.2 List the five major hardware components of a computer system.

A

1.2 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
3
Q

1.3 Internally, the CPU consists of what two units?

A

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

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

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

A

1.4 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
5
Q

1.5 What is a memory address? What is its purpose?

A

1.5 A unique number assigned to each section of memory.

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

1.6 Explain why computers have both main memory and secondary storage.

A

1.6 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
7
Q

1.7 What are the two general categories of software?

A

1.7 Operating Systems and Application Software

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

1.8 What fundamental set of programs control the internal operations of the
computer s hardware?

A

1.8 The operating system

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

1.9 What do you call a program that performs a specialized task, such as a virus
scanner, a file-compression program, or a data-backup program?

A

1.9 A utility program

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

1.10 Word processing programs, spreadsheet programs, e-mail programs, Web browsers,
and game programs belong to what category of software?

A

1.10 application software

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

1.11 What is an algorithm?

A

1.11 A set of well-defined steps for performing a task or solving a problem.

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

1.12 Why were computer programming languages invented?

A

1.12 To ease the task of programming. Programs may be written in a programming language,
and then converted to machine language.

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

1.13 What is the difference between a high-level language and a low-level language?

A

1.13 A low-level language is close to the level of the computer, and resembles the system’s
numeric machine language. A high-level language is closer to the level of human
readability, and resemble natural languages.

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

1.14 What does portability mean?

A

1.14 That a program may be written on one type of computer and run on another type.

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

1.15 Explain the operations carried out by the preprocessor, compiler, and linker.

A

The preprocessor reads the source file searching for commands that begin with the #
symbol. These are commands that cause the preprocessor to modify the source file in some
way. The compiler translates each source code instruction into the appropriate machine
language instruction, and creates an object file. The linker combines the object file with
necessary library routines.

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

1.16 Explain what is stored in a source file, an object file, and an executable file.

A

1.16 Source file: contains program statements written by the programmer.
Object file: machine language instructions, generated by the compiler translated
from the source file.
Executable file: code ready to run on the computer. Includes the machine language from
an object file, and the necessary code from library routines.

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

1.17 What is an integrated development environment?

A

1.17 A programming environment that includes a text editor, compiler, debugger, and other
utilities, integrated into one package.

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

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

A

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

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

1.19 Describe the difference between operators and punctuation symbols.

A

1.19 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
20
Q

1.20 Describe the difference between a program line and a statement.

A

1.20 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
21
Q

1.21 Why are variables called variable ?

A

1.21 Because their contents may be changed.

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

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

A

1.22 The original value is overwritten.

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

1.23 What must take place in a program before a variable is used?

A

1.23 The variable must be defined.

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

1.24 What are the three primary activities of a program?

A

1.24 Input, processing, and output.

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

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

A

1.25 The program’s purpose, information to be input, the processing to take place, and the
desired output.

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

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

A

1.26 To imagine what the computer screen looks like while the program is running. This helps
define input and output.

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

1.27 What is a hierarchy chart?

A

1.27 A chart that depicts each logical step of the program in a hierarchical fashion.

28
Q

1.28 Describe the process of desk-checking.

A

1.28 The programmer steps through each statement in the program from beginning to end. The
contents of variables are recorded, and screen output is sketched.

29
Q

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

A

1.29 It translates each source code statement into the appropriate machine language statement..

30
Q

1.30 What is a run-time error?

A

1.30 A logical error that occurs while the program is running.

31
Q

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

A

1.31 By the compiler

32
Q

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

A

1.32 To determine if a logical error is present in the program.

33
Q

1.33 Brie y describe the difference between procedural and object-oriented programming.

A

1.33 Procedural programs are made of procedures, or functions. Object-oriented programs are
centered on objects, which contain both data and the procedures that operate on the data.

34
Q
  1. Both main memory and secondary storage are types of memory. Describe the difference
    between the two.
A
  1. Main memory, or RAM, is volatile, which means its contents are erased when power is
    removed from the computer. Secondary memory, such as a disk, does not lose its contents
    when power is removed from the computer.
35
Q
  1. What is the difference between system software and application software?
A

Operating system software is a set of programs that manages the computer’s hardware devices and controls their processes.

Application software refers to programs that make the computer useful to the user.

36
Q
  1. What type of software controls the internal operations of the computer s hardware?
A
  1. An operating system
37
Q
  1. Why must programs written in a high-level language be translated into machine language
    before they can be run?
A

because machines only understand low-level language.

38
Q
  1. Why is it easier to write a program in a high-level language than in machine language?
A
  1. Because high level languages are more like natural language.
39
Q
  1. Explain the difference between an object file and an executable file.
A

Object file: the instructions of the error free source code is translated the compiler into appropriate instructions in machine language. not ready to run.

Executable file: The linker combines the object file and the library routines that are requires and creates a file. It is a complete program file that contains machine language instructions. ready to run

40
Q
  1. What is the difference between a syntax error and a logical error?
A
  1. A syntax error is the misuse of a key word, operator, punctuation, or other part of the programming
    language. A logical error is a mistake that causes the program to produce the
    wrong results.
41
Q
  1. Computers can do many different jobs because they can be __________.
A

programmed.

42
Q
  1. The job of the __________ is to fetch instructions, carry out the operations commanded
    by the instructions, and produce some outcome or resultant information.
A

cpu

43
Q
  1. Internally, the CPU consists of the __________ and the __________.
A

Arithmetic and logic unit and control unit.

44
Q
  1. A(n) __________ is an example of a secondary storage device.
A

disk

45
Q
  1. The two general categories of software are __________ and __________.
A

system software and application software

46
Q
  1. A program is a set of __________.
A

instructions

47
Q
  1. Since computers can’t be programmed in natural human language, algorithms must be
    written in a(n) __________ language.
A

programming

48
Q
  1. __________ is the only language computers really process.
A

machine language

49
Q
  1. __________ languages are close to the level of humans in terms of readability.
A

high level

50
Q
  1. __________ languages are close to the level of the computer.
A

low level

51
Q
  1. A program’s ability to run on several different types of computer systems is called
    __________.
A

portability

52
Q
  1. Words that have special meaning in a programming language are called __________.
A

key word

53
Q
  1. Words or names defined by the programmer are called __________.
A

programmer defined identifiers

54
Q
  1. __________ are characters or symbols that perform operations on one or more
    operands.
A

operators

55
Q
  1. __________ characters or symbols mark the beginning or ending of programming
    statements, or separate items in a list.
A

punctuation

56
Q
  1. The rules that must be followed when constructing a program are called __________.
A

syntax

57
Q
  1. A(n) __________ is a named storage location.
A

variable

58
Q
  1. A variable must be __________ before it can be used in a program.
A

defined

59
Q
  1. The three primary activities of a program are __________, __________, and
    __________.
A

input, processing, output

60
Q
  1. __________ is information a program gathers from the outside world.
A

input

61
Q
  1. __________ is information a program sends to the outside world.
A

output

62
Q
  1. A(n) __________ is a diagram that graphically illustrates the structure of a program.
A

hierarchy chart

63
Q

Predict the Result
Questions 33 35 are programs expressed as English statements. What would each display
on the screen if they were actual programs?
33. The variable x starts with the value 0.
The variable y starts with the value 5.
Add 1 to x.
Add 1 to y.
Add x and y, and store the result in y.
Display the value in y on the screen.

A

7

64
Q
34. The variable j starts with the value 10.
The variable k starts with the value 2.
The variable l starts with the value 4.
Store the value of j times k in j.
Store the value of k times l in l.
Add j and l, and store the result in k.
Display the value in k on the screen.
A

28

65
Q
  1. The variable a starts with the value 1.
    The variable b starts with the value 10.
    The variable c starts with the value 100.
    The variable x starts with the value 0.
    Store the value of c times 3 in x.
    Add the value of b times 6 to the value already in x.
    Add the value of a times 5 to the value already in x.
    Display the value in x on the screen.
A

365