Object Oriented Design Test 1

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

The source code file and any other files that use a class can include the classes header via a ________ preprocessing directive.

#include

A class definition is typically stored in a file with the __________ file name extension.

.h

Most C++ statements end with a ________.

;

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 its declaration to the closest brace of the block in which it's declared. It data number is declared in a class, but not in the body of any of the classes member functions. Every object of a class has each of the classes data members. Data members are accessible to all member functions of the class.

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 function is specified in the function header. The Argument is the value supplied in the function call. When the function is called, the argument value is passed into the function parameters so that the function can perform its task.

Keyword public is an _________.

Access specifier

______________ is an operating system for mobile devices based on the Linux kernel and Java.

Android

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

Class

The _____________ creates object code and stores it on disk.

Compiler

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

Compilers

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

Data member

C++ programs are normally typed into a computer using an _________ program.

Editor

Phase 1

Editor

Phase 6

Execution

(T/F) The default case is required in the switch selection statement.

False. Default case is optional, considered good software engineering to always provide a default case.

(T/F) by convention, function names begin with a capital letter and all subsequent words in the name begin with a capital letter.

False. Function names begin with a lowercase letter and all subsequent words in the name begin with a capital letter.

(T/F) variables declared in the body of the particular member function are known as data members and can be used in all member functions of the class.

False. Such variables are local variables and can be used only in the member function in which they're declared.

(T/F) The break statement is required in the default statement to exit the switch properly.

False. The switch statement is used to exit the switch statement. The break statement is not required when the default case is the last case. Nor will the break statement be required if not having control proceed with the next case makes sense.

When the compiler selects the proper function to call by examining the number, types, and order of the arguments in the call.

Function overloading

Function ____________ from the <string> Library reads characters until a new line character is encountered, then copies those characters into the specified string.

Getline

The ___________ statement is used to make decisions.

If

The key logical units of the computer already ________, ___________, __________, ____________, and ____________.

Input unit, output unit, memory unit, central processing unit, arithmetic in the logic unit, secondary storage unit.

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

Linker

Phase 4

Linking

The ______________ program transfers the executable program from disk to memory.

Loader

Phase 5

Loading

The three types of languages discussed in this chapter are _________, ____________, and _____________.

Machine languages, assembly languages, high-level languages.

Every C plus plus program begins execution of the function __________.

Main

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

Newline

In a C++ system a _____________ program executes before the compilers translation phase begins.

Pre processor

Computers process data under the control of sets of instructions called ___________.

Programs

___________ is an artificial and informal language that helps you develop algorithms.

Pseudocode

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.

Scope resolution operator (::)

When it isn't known in advance how many times a set of statements will be repeated, a _____________ value can be used to terminate the repetition.

Sentinel, signal, flag, or dummy

All programs can be written in terms of three types of control structure: __________________, ________________, and ____________.

Sequence, selection, and repetition

for (unsigned int count = 1; count <= 99; count += 2) sum += count;

Sum of odd intergers between 1 and 99 using for statement.

The linker links

The object code with the external libraries.

When c++ statements enable you to specify that the next statement to execute may be other than the next one in sequence

Transfer of control

(T/F) It is possible to declare local and global variables of the same name.

True

(T/F) Any source code file that contains INT main () can be used to execute a program.

True.

(T/F) Data members or member functions declared with access specifier private are accessible to member functions of the class in which they're declared.

True.

(T/F) The types of arguments in a function call must be consistent with the types of the corresponding parameters in the function Proto types parameter list.

True.

(T/F) empty parentheses following a function name in a function prototype indicate that the function does not require any parameters to perform its task.

True.

(T/F) every functions body is delimited by left and right braces.

True.

Each parameter in a function header specifies both a __________ and a __________.

Type, name

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

Void

An __________ is procedure for solving a problem in terms of the actions to execute and the order in which the actions execute

algorithm

Phase 3

compiler translates

Repeating a set of instructions a specific number of times is called ___________ repetition.

counter-controlled or definite

A program that invokes a function repeatedly with the same argument value has a ___________ to be passed to that parameter.

default argument

The __________ contain the function prototypes for the related functions that form each portion of the library.

header file

The __________ selection statement is used to execute one action when a condition is true or a different action when that condition is false.

if....else

C++ provides ____________ to help reduce function call overhead --- especially for small functions.

inline functions

Phase 2

pre processor executes

Specifying the order in which statements execute in a computer program is called _________.

program control

Default arguments must be the _________ in a functions parameter list.

rightmost (trailing) arguments

Statements in a program execute one after the other in the order in which they're written, this is called

sequential execution

All function template definitions begin with the _____________ followed by a _______________ to the function template enclosed in angle brackets < >

template keyword, template parameter list

Every parameter in the template parameter list is preceded by the keyword _________ or keyword _________

typename, class

To access a global variable when a local with the same name is present, what operator do you use?

unary scope resolution operator (::)

A(n) __________ begins the body of every function and a __________ ends the body.

{ }


Conjuntos de estudio relacionados

PSY 201 Chapter 16 Practice Questions

View Set

Anatomy Chapter 12 Review Questions

View Set

Gerioù Brezhoneg-Saozneg (Breton-English Vocabulary)

View Set

LSU 1101 BOYAJIAN HOMEWORKS #1-5

View Set

Tools For Data Science (Course 2)

View Set