Computer Sci test 1

Apple

The company that popularized personal computing was ________.

IBM

The computer that made personal computing legitimate in business and industry was the ________.

Programs

Computers process data under the control of sets of instructions called computer _________.

input unit - output unit - memory unit - arithmetic and logic unit - central processing unit - secondary storage unit

The six key logical units of the computer are the ________, ________, ________, _________, _________ and the ________.

machine languages - assembly languages - high-level languages

,The three classes of languages discussed in the chapter are ________, ________, and ________.

compilers

The programs that translate high-level language programs into machine language are called ________.

UNIX

C is widely known as the development language of the ________ operating system.

Pascal

The ________ language was developed by Wirth for teaching structured programming.

Multitasking

The Department of Defense developed the Ada language with a capability called ________, which allows programmers to specify that many activities can proceed in parallel.

editor

C++ programs are normally typed into a computer using a(n) ________ program.

preprocessor

In a C++ system, a(n) ________ program executes before the compiler's translation phase begins.

linker

The ________ program combines the output of the compiler with various library functions to produce an executable image.

loader

The ________ program transfers the executable image of a C++ program from disk to memory.

information hiding

Objects have the property of ________although objects may know how to communicate with one another across well-defined interfaces, they normally are not allowed to know how other objects are implemented.

classes

C++ programmers concentrate on creating ________, which contain data members and the member functions that manipulate those data members and provide services to clients.

associations

Classes can have relationships with other classes. These relationships are called ________.

object-oriented analysis and design (OOAD)

The process of analyzing and designing a system from an object-oriented point of view is called ________.

inheritance

OOD also takes advantage of ________ relationships, where new classes of objects are derived by absorbing characteristics of existing classes, then adding unique characteristics of their own.

Unified Modeling Language(UML)

________ is a graphical language that allows people who design software systems to use an industry-standard notation to represent them.

attributes

The size, shape, color and weight of an object are considered

Why might you want to write a program in a machine-independent language instead of a machine-dependent language? Why might a machine-dependent language be more appropriate for writing certain types of programs?

Machine independent languages are useful for writing programs to be executed on multiple computer platforms. Machine dependent languages are appropriate forwriting programs to be executed on a single platform.

input unit

Which logical unit of the computer receives information from outside the computer foruse by the computer?

computer programming

The process of instructing the computer to solve specific problems is called

assembly language

What type of computer language uses English-like abbreviations for machine language instructions?

output unit

Which logical unit of the computer sends information that has already been processed by the computer to various devices so that the information may be used outside the computer?

memory unit and secondary storage unit

Which logical units of the computer retain information?

arithmetic and logical unit

Which logical unit of the computer performs calculations?

arithmetic and logical unit

Which logical unit of the computer makes logical decisions?

high-level language

The level of computer language most convenient to the programmer for writing programs quickly and easily is

machine language

The only language that a computer directly understands is called that computer's

central processing unit

Which logical unit of the computer coordinates the activities of all the other logical units?

Machine languages are generally

machine dependent

stdin

This refers to the standard input device. The standard input device is normally connected to the keyboard

stdout

This refers to the standard output device. The standard output device is normally connected to the computer screen.

stderr

This refers to the standard error device. Error messages are normally sent to this device which is typically connected to the computer screen.

Why is so much attention today focused on object-oriented programming?

Object-oriented programming enables the programmer to build reusable software components that model items in the real world. Building software quickly, correctly,and economically has been an elusive goal in the software industry. The modular, ob-ject-orie

FORTRAN

Developed by IBM for scientific and engineering applications

COBOL

Developed specifically for business applications.

Pascal

Developed for teaching structured programming

Ada

Named after the world's first computer programmer

BASIC

Developed to familiarize novices with programming techniques

C#

Specifically developed to help programmers migrate to .NET.

C

Known as the development language of UNIX

C++

Formed primarily by adding object-oriented programming to C

Java

Succeeded initially because of its ability to create web pages with dynamic content

main

Every C++ program begins execution at the function _________.

{ }

The _________ begins the body of every function and the _________ ends the body of every function.

semicolon

Every C++ statement ends with a(n) _________.

new line

The escape sequence \n represents the _________ character, which causes the cursor to position to the beginning of the next line on the screen.

//

Comments do not cause the computer to print the text after the____ on the screen when the program is executed.

/n

The escape sequence ___, when output with cout and the stream insertion operator, causes the cursor to position to the beginning of the next line on the screen.

variables

All ______ must be declared before they are used.

case sensitive

All C++ Variables are_________.

integer operands

The modulus operator (%) can be used only with __________.

int c, thisIsAVariable, q76354, number;

Declare the variables c, thisIsAVariable, q76354 and number to be of type int.

std::cout << "Enter an integer: ";

Prompt the user to enter an integer. End your prompting message with a colon (:) followed by a space and leave the cursor positioned after the space.

std::cin >> age;

Read an integer from the user at the keyboard and store the value entered in integer variable age.

if ( number != 7 )

...

std::cout << "The variable number is not equal to 7\n";

If the variable number is not equal to 7, print "The variable number is not equal to 7".

std::cout << "This is a C++ program\n";

Print the message "This is a C++ program" on one line.

std::cout << "This is a C++\nprogram\n";

Print the message "This is a C++ program" on two lines. End the first line with C++.

std::cout << "This\nis\na\nC++\nprogram\n";

Print the message "This is a C++ program" with each word on a separate line.

std::cout << "This\tis\ta\tC++\tprogram\n";

Print the message "This is a C++ program" with each word separated from the next by a tab.

// Calculate the product of three integers

Comment that a program calculates the product of three integers.

int x;int y;int z;int result;

Declare the variables x, y, z and result to be of type int (in separate statements).

cout << "Enter three integers: ";

Prompt the user to enter three integers.

cin >> x >> y >> z;

Read three integers from the keyboard and store them in the variables x, y and z.

result = x
y
z;

Compute the product of the three integers contained in variables x, y and z, and assign the result to the variable result.

cout << "The product is " << result << endl;

Print "The product is " followed by the value of the variable result.

return 0;

Return a value from main indicating that the program terminated successfully.

Comments

_____ are used to document a program and improve its readability.

cout

The object used to print information on the screen is _____.

if

A C++ statement that makes a decision is ______.

assignment

Most calculations are normally performed by ______ statements.

valid variable names

_under_bar_, m928134, t5, j7, her_sales, his_account_total, a, b, c, z, z2.

/ %

What arithmetic operations are on the same level of precedence as multiplication? ______.

object

A house is to a blueprint as a(n) _________ is to a class.

class

Every class definition contains keyword _________ followed immediately by the class's name.

.h

A class definition is typically stored in a file with the _________ filename extension.

type, name

Each parameter in a function header should specify both a(n) _________ and a(n) _________.

data member

When each object of a class maintains its own copy of an attribute, the variable that represents the attribute is also known as a(n) _________.

access specifier

Keyword public is a(n) _________

void

Return type _________ indicates that a function will perform a task but will not return any information when it completes its task.

getline

Function _________ from the <string> library reads characters until a newline character is encountered, then copies those characters into the specified string.

binary scope resolution operator (::)

When a member function is defined outside the class definition, the function header must include the class name and the _________, followed by the function name to "tie" the member function to the class definition.

#include

The source-code file and any other files that use a class can include the class's header file via an _________ preprocessor directive.

Sequence, selection and repetition

All programs can be written in terms of three types of control structures:_______, ________and_________.

if...else

The_________selection statement is used to execute one action when a condition is TRue or a different action when that condition is false.

What is the difference between a local variable and a data member?

A local variable is declared in the body of a function and can be used only from the point at which it is declared to the immediately following closing brace. A data member is declared in a class definition, but not in the body of any of the class's membe

Explain the purpose of a function parameter. What is the difference between a parameter and an argument?

A parameter represents additional information that a function requires to perform its task. Each parameter required by a function is specified in the function header. An argument is the value supplied in the function call. When the function is called, the

Counter-controlled or definite

Repeating a set of instructions a specific number of times is called_________repetition.

Sentinel, signal, flag or dummy

When it is not known in advance how many times a set of statements will be repeated, a(n)_________value can be used to terminate the repetition.