Starting out with C++ Chapter 1

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

_____ are characters or symbols that perform operations on one or more operands .

Directives

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

High level

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

High level language: The easiest languages for people to learn, they are closer to the level of human-readability than computer-readability. Low level: close to the level of the computer, resembles the numeric machine language of the computer more than the natural language of humans.

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

portability

What is the difference between high-level pseudocode and detailed pseudocode?

High-level pseudocode simply lists the steps a program must perform. Detailed pseudocode: High-level pseudocode expanded, it names variables and tells what mathematical operations to perform.

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

syntax

List the five major hardware components of a computer system.

- The central processing unit (CPU) - Main memory (random -access memory, or RAM) - Secondary storage devices - Input devices - Output devices

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 Program

The three primary activities of a program are _____

fetch, decode , and execute

Why were computer programming languages invented?

to ease the task of programming. A program can be written in a programming language such as C++, which is much easier to understand and write than machine language.

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

translate the source code to machine language.

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

low level

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

external hardrive

A(n) _____ is a diagram that graphically illustrates the Structure of a program.

hierarchy chart

A program is a set of _____

instructions

Words that have special meaning in a programming language are called _____ words

key

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

all variables must be defined before they can be used because the variable definition is what causes the variables to be created in memory

The two general categories of software are _____and______

application software, system software

Why are variables called "variable"?

because the data stored in variables may change while the program is running

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

because they can be programmed. computers are not designed to do just one job, but to do any job that their programs tell them to do.

What is an integrated development environment?

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

Internally, the CPU consists of what two units?

control unit and the arithmetic and logic unit (ALU).

What is pseudocode?

cross between human language and a programming language.

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

defined

What is a hierarchy chart?

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 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 does it mean to "visualize a program running"? What is the value of doing this?

Before you create a program on the computer, you should first create it in your mind. Try to imagine what the computer screen looks like while the program is running. In this step, you must put yourself in the shoes of the user. By addressing these issues, you will have already determined most of the program's output .

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

CPU

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

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

Main memory/RAM, is volatile, 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.

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

Operating Systems

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

Preprocessor: reads the source code. searches for special lines that begin with the # symbol. These lines contain commands, or directives, that cause the preprocessor to amend or process the source code in some way. Compiler: steps through the preprocessed source code, translating each source code instruction into the appropriate machine language instruction. This will uncover any syntax errors that may be in the program. Linker: combines the object file with the necessary library routines.

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

Program Line: a single line as it appears in the body of a program. Statement: complete instruction that causes the computer to perform some action.

What are the two general categories of software?

System Software and Application Software

What does portability mean?

a C++ program can be written on one type of computer and then run on many other types of systems.

What is a memory address? What is its purpose?

a unique number that each byte is assigned. A byte is identified by its address, so that the data stored there can be located.

What is a logic error?

mistakes that cause a program to produce erroneous results. Examples of logical errors would be using the wrong variable's value in a computation or performing order-dependent actions in the wrong order.

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

Purpose, Input, Processing, Output

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

Application Software/ Application Programs

_____ is information a program gathers from the outside world.

Input

What are the three primary activities of a program?

Input, processing and output

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

Key word: reserved and cannot be used for anything other than their designated purposes. Programmer - defined symbol: They are not part of the C++ language but rather are names made up by the programmer. Can be names of variables.

_____ languages are close to the level of the computer.

Low Level

______ is the only language computers really process

Machine language

Explain why computers have both main memory and secondary storage.

Main Memory: where the computer stores a program while the program is running, as well as the data that the program is working with. AKA random-access memory or RAM. It is called this because the CPU is able to quickly access data stored at any random location in this memory. it's usually a volatile type of memory that's used only for temporary storage while a program is running. Secondary storage: memory that can hold data for long periods of time even when there is no power to the computer.

Describe the difference between operators and punctuation symbols.

Operators: They perform operations on pieces of data, known as operands. Punctuation: A semicolon in C++ is similar to a period in English. It marks the end of a complete sentence (or statement, as it is called in programming).

_____ characters or symbols mark the beginning or ending of programming statements, or separate items in a list.

Punctuation

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

Source file: statements written by the programmer are called source code Object file: compiler stores the translated machine language instructions, which are called object code Executable file: contains machine language instructions, or executable code, and is ready to run on the computer.

Internally, the CPU consists of the ___ and the ___

main memory, random access memory

What is a run-time error?

occurs when the running program asks the computer to do something that is impossible. Normally a run-time error causes the program to abort.

_____ is information a program sends to the outside world.

output

Describe the process of desk-checking.

process that can help locate these types of errors . The term desk-checking means the programmer starts reading the program , or a portion of the program , and steps through each statement.

Computers can do many different jobs because they can be ______

programmable

What is an algorithm?

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

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

the data stored in the variable changes

A(n) _____ is a named storage location.

variable

Words or names defined by the programmer are called _____

variables


Kaugnay na mga set ng pag-aaral

AP Macroeconomics Unit 1: Basic Economic Concepts

View Set

wmu marketing 2500 midterm- Dr. J

View Set

HESI Case study Breathing patterns 2

View Set

Ch. 3 Vocab — Data Description

View Set

6-4 Calculating body surface area

View Set

Network+ Practice test Questions

View Set