Chapter 1 Flashcards

1
Q

1.2 List the five main major 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
2
Q

1.3 Internally, the CPU consists of what two units?

A

Control Unit and the Arithmetic and Logic Unit

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

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

A

Fetch
The CPU’s control unit fetches, from main memory, the next instruction in the sequence of program instructions.
Decode
The instruction is encoded in the form of a number. The control unit decodes the instruction and generates an electronic signal.
Execute
The signal is routed to the appropriate component of the computer
(such as the ALU, a disk drive, or some other device). The signal causes the component to perform an operation.

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

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

A

A unique number assigned to a byte. It is used to identify a byte.

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

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

A

Main memory is the workspace where things get loaded in and worked on in real time. Stores the program and associated data as the program is running so the CPU is able to quickly access data. Secondary storage are the cabinets and shelves where the programs are saved for use. Holding the programs and data for longer periods of time.

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

1.7 What are the two general categories of software?

A

System Software and Application Software

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

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

A

Operating System

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
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

Utility Program

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

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

A

Application Software

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

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

A

Because the computer can do a variety of things because they can be programmed. This means computers are not designed to do just one job, but any job that their programs tell them to do.

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

1.11 What is an algorithm?

A

set of well-defined steps in their proper sequence 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

To provide an easier more readable way to create programs.

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 and low-level language?

A

A high-level language closer to the level of human readability than computer readability.
While a low level language is closer to the level of the CPU, resembling the numeric machine language

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

1.14 What does portability mean?

A

ability to be used on different systems

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

Preprocessor
First phase of translating programming language code into machine language. searches for special lines beginning with # symbol which contain commands to modify the source code in some way.
Compiler
After the preprocessor phase, translates each source code instruction into the appropriate machine language instruction.
Linker
Combines 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

Source File
name of the file comprised of programmer statements(source code)
Object File
File that contains the Object Code(translated machine language instructions)
Executable File
contains executable code(machine language instructions) and is created after the linker finishes.

17
Q

1.17 What is an integrated development environment?

A

consists of a text editor, compiler, debugger, and other utilities integrated into a package within a single set of menus.

18
Q

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

A

Key Words
aka reserved words have a special meaning and may only be used for their intended purpose.

Programmer-Defined Identifiers
are words or names defined by the programmer. They are symbolic names that refer to variables or programming routines.

19
Q

1.19 Describe the difference between operators and punctuation symbols.

A

Operators
perform operations on one or more operands. An operand is usually a piece of data, like a number.
Punctuation
characters mark the beginning or end of a statement, or separate items in a list.

20
Q

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

A

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

21
Q

1.21 Why are variables called “variable”?

A

Variables are called variables because they can change their value while the program is running.

22
Q

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

A

They are replaced by the new value.

23
Q

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

A

It must be created in memory which occurs after the assignment of a variable definition.

24
Q

1.24 What are the three primary activities of a program?

A

Input, Processing, Output

25
Q

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

A

Translates each source code instruction into the appropriate machine language instruction.

26
Q

1.30 What is a runtime error?

A

an error that occurs while the program is running.

27
Q

1.31 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.

28
Q

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

A

Testing for runtime errors requires that the program be executed with sample data or
sample input. The sample data should be such that the correct output can be predicted. If the program does not produce the correct output, a logical error is present in the program.

29
Q

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

A

Procedural Programming
the programmer constructs procedures which are collections of programming statements that perform a specific task.

Object-Oreinted Programming
centered on the object. An object is a programming element that contains data and the procedures that operate on the object.

The objects contain, within themselves, both information and the ability to manipulate the information. Operations are carried out on the information in an object by sending the object a message. When an object receives a message instructing it to perform some operation, it carries out the instruction.

30
Q

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

A

design, creation, testing, and debugging
purpose, input, process, output

31
Q

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

A

To “visualize a program running” is to imagine what the computer screen looks
like while the program is running. The value in this step, is putting yourself in the shoes of the user to determine most of the program’s output.

32
Q

1.27 What is a hierarchy chart?

A

A hierarchy chart is a diagram that graphically depicts the structure of a program. It has boxes that represent each step in the program. The boxes are connected in a way that illustrates their relationship to one another.

A hierarchy chart begins with the overall task then refines it into smaller subtasks. Each of the subtasks is then refined into even smaller sets of subtasks, until each is small enough to be easily performed.

33
Q

1.28 Describe the process of desk-checking.

A

desk-checking means the programmer starts reading the program, or a portion of the program, and steps through each statement.

A sheet of paper is often used in this process to jot down the current contents of all variables and sketch what the screen looks like after each output operation.

When a variable’s contents change, or information is displayed on the screen, this is noted. By stepping through each statement, many errors can be located and corrected.

If an error is a result of incorrect logic (such as an improperly stated math formula), you must correct the statement or statements involved in the logic.

If an error is due to an incomplete understanding of the program requirements, then you must restate the program purpose and modify the hierarchy and/or flowcharts, pseudocode, and source code.

34
Q

return 0;

A

sends the integer value 0 back to the operating system upon the program’s completion. The value 0 usually indicates that a program executed successfully.

35
Q

modulus operator

A

returns the remainder of an integer division.