Chapter 1 Checkpoints & Review Questions

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

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

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.

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

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.

What does portability mean?

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

List the five major hardware components of a computer system:

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

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

The operating system

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

The original value is overwritten

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

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

Why were computer programming languages invented?

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

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

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

Words that have special meaning in a programming language are called _________.

key words

A program's ability to run on several different types of computer systems is called _________.

portability

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

7

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

Application software

Internally, the CPU consists of the _________ and the _________.

Arithmetic Logic Unit and Control Unit

Internally, the CPU consists of what two units?

Arithmetic and Logic Unit (ALU), and Control Unit

The rules that must be followed when constructing a program are called __________.

syntax

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.

28

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.

365

What is a hierarchy chart?

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

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

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.

Describe the difference between a program line and a statement.

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.

What is a runtime error?

A logical error that occurs while the program is running.

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, and resembles the system's numeric machine language. A high-level language is closer to the level of human readability, and resemble natural languages.

What is an integrated development environment?

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

What is an algorithm?

A set of well-defined logical steps that must be taken to perform a task.

What is the difference between a syntax error and a logical error?

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.

What is a memory address? What is its purpose?

A unique number assigned to each section of memory.

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

Explain the difference between an object file and an executable file.

An object file contains machine language instructions, but it does not contain code for any library routines that may be necessary. An executable file is a program, ready to run. It contains the machine language code translated from the programmer's source file, as well as the code for any necessary library routines.

What type of software controls the internal operations of the computer's hardware?

An operating system

What is the difference between system software and application software?

An operating system is a set of programs that manages the computer's hardware devices and controls their processes. Application software consists of programs that users use to solve specific problems or perform general operations.

Why is it easier to write a program in a high-level language than in machine language?

Because high level languages are more like natural language.

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

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

Why must programs written in a high-level language be translated into machine language before they can be run?

Because the computer only processes machine language instructions.

Why are variables called "variable"?

Because their contents may be changed.

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

By the compiler

The job of the _________ is to fetch instructions, carry out the operations commanded by the instructions, and produce some outcome or resultant information.

CPU

What are the three primary activities of a program?

Input, processing, and output.

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

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

Both main memory and secondary storage are types of memory. Describe the difference between the two.

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.

The two general categories of software are _________ and _________.

Operating Systems and Application Software

What are the two general categories of software?

Operating Systems and Application Software

Describe the difference between operators and punctuation symbols.

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

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

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.

Explain why computers have both main memory and secondary storage.

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.

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

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.

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

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

Describe the process of desk-checking

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

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

The variable must be defined.

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

defined

A(n) _________ is an example of a secondary storage device.

disk

A(n) __________ is a diagram that graphically illustrates the structure of a program

hierarchy chart

________ languages are close to the level of humans in terms of readability.

high-level

__________ is information a program gathers from the outside world.

input

The three primary activities of a program are __________, __________, and __________.

input, processing, output

A program is a set of _________.

instructions

_________ languages are close to the level of the computer.

low-level

_________ is the only language computers really process.

machine language

_________ are characters or symbols that perform operations on one or more operands

operators

__________ is information a program sends to the outside world.

output

Computers can do many different jobs because they can be _________.

programmed

Words or names defined by the programmer are called _________.

programmer-defined symbols

Since computers can't be programmed in natural human language, algorithms must be written in a(n) _________ language.

programming language

__________ characters or symbols mark the beginning or end of programming statements, or separate items in a list

punctuation

A(n) __________ is a named storage location.

variable


संबंधित स्टडी सेट्स

Citi Certifications for Psychology

View Set

What Are The Two Types Of Cells?

View Set