Chapter 1: Introduction to Computers and Programming

¡Supera tus tareas y exámenes ahora con Quizwiz!

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

Purpose, Input, Process, Output

Describe the difference between a program line and a statement.

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

What is a hierarchy chart?

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.

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

A low-level language is close to the level of the computer, which means it resembles the numeric machine language of the computer more than the natural language of humans. The easiest languages for people to learn are high-level languages. They are called "high- level" because they are closer to the level of human-readability than computer-readability.

What does portability mean?

A program can be written on one type of computer and then run on many other types of systems

What is an algorithm?

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

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

A syntax error is found by the compiler.

What is a run-time error?

An error that occurs while the program is running.

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

Application Software

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

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

Why were computer programming languages invented?

Programming languages, which use words instead of numbers, were invented to ease the task of programming.

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

Create the program in your mind. Ask "What messages should the program display? What questions should it ask?" This will help determine the program's output.

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

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.

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

If the program does not produce the correct output, a logical error is present in the program.

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

In procedural programming, the programmer constructs procedures (or functions, as they are called in C++). The procedures are collections of programming statements that perform a specific task. The procedures each contain their own variables and commonly share variables with other procedures. Object-oriented programming (OOP), on the other hand, is centered on the object. An object is a programming element that contains data and the procedures that operate on the data. It is a self-contained unit.

What are the three primary activities of a program?

Input, Processing, and Output

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?

Utility Programs

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

Key Words - Words that have a special meaning. Key words may only be used for their intended purpose. Key words are also known as reserved words. Programmer-Defined Identifiers - Words or names defined by the programmer. They are symbolic names that refer to variables or programming routines.

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

Only one item may be stored in the box at any given time. If the program stores another value in the box, it will take the place of the original value.

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

Operating Systems

Describe the difference between operators and punctuation symbols.

Operators - Performs operations on one or more operands. An operand is usually a piece of data, like a number. Punctuation - Characters that mark the beginning or ending of a statement, or separate items in a list.

Explain why computers have both main memory and secondary storage.

RAM is usually a volatile type of memory that is used only for temporary storage while a program is running. Secondary storage is a type of memory that can hold data for long periods of time.

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

Source code is stored in a source file. Translated machine instructions, or object code, is stored in an object file. Machine language instructions, or executable code, is stored in an executable file.

What are the two general categories of software?

System software and application software

Internally, the CPU consists of what two units?

The CPU's job is to fetch instructions, follow the instructions, and produce some result. Internally, the central processing unit consists of two parts: the control unit and the arith- metic and logic unit (ALU). The control unit coordinates all of the computer's operations. It is responsible for determining where to get the next instruction and regulating the other major components of the computer with control signals. The arithmetic and logic unit, as its name suggests, is designed to perform mathematical operations.

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

The compiler steps through the preprocessed source code, translating each source code instruction into the appropriate machine language instruction. This process will uncover any syntax errors that may be in the program.

Why are variables called "variable"?

The information stored in variables may change while the program is running (hence the name "variable").

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

The preprocessor searches for special lines that begin with the # symbol. These lines contain commands that cause the preprocessor to modify the source code in some way. The compiler steps through the preprocessed source code, translating each source code instruction into the appropriate machine language instruction. This process will uncover any syntax errors that may be in the program. The linker combines the object file with the necessary library routines. Once the linker has finished with this step, an executable file is created.

Describe the process of desk-checking.

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.

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

The variables must be defined before they can be used.

What is an integrated development environment?

These environments consist of a text editor, compiler, debugger, and other utilities integrated into a package with a single set of menus. Preprocessing, compiling, linking, and even executing a program is done with a single click of a button, or by selecting a single item from a menu.

List the five major hardware components of a computer system.

• The central processing unit (CPU) • Main memory • Secondary storage devices • Input devices • Output devices


Conjuntos de estudio relacionados

PEDO (L'examen en dentisterie pédiatrique)

View Set

Geography 332 - Study Guide for Megalopolis

View Set

Thirteenth, Fourteenth, & Fifteenth Amendments

View Set

Environmental Science Chapter 5: Species Interactions, Ecological Succession, and Population Control

View Set

Biology Unit 12 (mosses & ferns)

View Set

Chapter 22 - Staphylococcus and Micrococcus

View Set

Sentence Types, Parts, & Structure

View Set

(Oct) Study Questions for Lifepac Test 2

View Set