N EO
Quiz by , created more than 1 year ago

Exam review

3
0
0
N EO
Created by N EO about 5 years ago
Close

Section 1-7

Question 1 of 70

1

The ____ and ____ were established to standardize the syntax of C++.

Select one of the following:

  • American National Standard Organization (ANSO); International Standard Institute (ISI)

  • American Standard Code for Information Interchange (ASCII); International Standard Organization (ISO)

  • American National Standard Institution (ANSI); International Standard Organization (ISO)

  • American National Standard Institution (ANSI); Unicode
    Analysis

Explanation

Question 2 of 70

1

The language of a computer is called ____.

Select one of the following:

  • machine language

  • assembly language

  • source code

  • system code

Explanation

Question 3 of 70

1

A(n) ____ monitors the overall activity of the computer and provides services.

Select one of the following:

  • compiler

  • assembler

  • control unit

  • operating system

Explanation

Question 4 of 70

1

A program called the ____ combines the object program with other programs in the library and is used in the program to create the executable code.

Select one of the following:

  • joiner

  • linker

  • combiner

  • assembler

Explanation

Question 5 of 70

1

A(n) ____ is a unique location in main memory for each cell.

Select one of the following:

  • counter

  • address

  • register

  • signal

Explanation

Question 6 of 70

1

ASCII is a(n) ____-bit code.

Select one of the following:

  • seven

  • sixteen

  • eight

  • two

Explanation

Question 7 of 70

1

A(n) _____ program is the machine language version of the high-level language program.

Select one of the following:

  • source

  • object

  • preprocessor

  • linker

Explanation

Question 8 of 70

1

Word processors, games, and spreadsheets are examples of ____ programs.

Select one of the following:

  • system

  • source

  • application

  • operating

Explanation

Question 9 of 70

1

Main memory consists of an ordered sequence of ____.

Select one of the following:

  • memory cells

  • registers

  • logical units

  • signals

Explanation

Question 10 of 70

1

In a C++ program, statements that begin with the # symbol are called ____ directives.

Select one of the following:

  • library

  • preprocessor

  • operator

  • postprocessor

Explanation

Question 11 of 70

1

If all operands in an expression are integers, the expression is called a(n) _____ expression.

Select one of the following:

  • single precision

  • integral

  • integer

  • double precision

Explanation

Question 12 of 70

1

____ are names of things that appear in a program, such as variables, constants, and functions.

Select one of the following:

  • Comments

  • Tokens

  • Data types

  • Identifiers

Explanation

Question 13 of 70

1

A string containing no characters is called a(n) ____ string.

Select one of the following:

  • empty

  • missing

  • zero

  • non

Explanation

Question 14 of 70

1

The smallest individual unit of a program written in any language is called a _____.

Select one of the following:

  • bit

  • token

  • symbol

  • byte

Explanation

Question 15 of 70

1

In C++, a ____ is used to end a statement.

Select one of the following:

  • forward slash

  • semicolon

  • comma

  • period

Explanation

Question 16 of 70

1

In C++, the cast operator takes the following form: ____.

Select one of the following:

  • static_cast<dataTypeName>(expression)

  • static_cast<dataTypeName>

  • static_cast (expression)

  • expression<static_cast> (dataTypeName)

Explanation

Question 17 of 70

1

When using the char data type, you enclose each character represented within ____.

Select one of the following:

  • parentheses

  • double quotation marks

  • single quotation marks

  • brackets

Explanation

Question 18 of 70

1

A(n) ____ is a set of values together with a set of operations.

Select one of the following:

  • function

  • sequence

  • data type

  • operand

Explanation

Question 19 of 70

1

The _____ data type is used to represent any real number between -3.4E+38 and 3.4E+38.

Select one of the following:

  • double

  • int

  • float

  • long double

Explanation

Question 20 of 70

1

_____ lines are executable statements that inform the user what to do.

Select one of the following:

  • Prompt

  • Comment

  • Document

  • Question

Explanation

Question 21 of 70

1

To force floating-point output to show the decimal point and trailing zeros, use the ____ manipulator.

Select one of the following:

  • point

  • scientific

  • showpoint

  • decimal

Explanation

Question 22 of 70

1

The ____ manipulator controls the output of only the next expression.

Select one of the following:

  • fixed

  • setprecision

  • setw

  • showpoint

Explanation

Question 23 of 70

1

The extraction operator takes ____ operands.

Select one of the following:

  • zero

  • one

  • two

  • three

Explanation

Question 24 of 70

1

The output stream variables can use the manipulator ____ to fill the unused columns with a character other than a space.

Select one of the following:

  • setw

  • charfill

  • setfill

  • setchar

Explanation

Question 25 of 70

1

Variables of type ____ are called input stream variables.

Select one of the following:

  • istream

  • stream

  • ostream

  • iostream

Explanation

Question 26 of 70

1

The manipulator ____ is used to output floating-point numbers in scientific format.

Select one of the following:

  • sets

  • fixed

  • scientific

  • setsci

Explanation

Question 27 of 70

1

I/O functions are typically called ____ member functions.

Select one of the following:

  • stream

  • common

  • access

  • user

Explanation

Question 28 of 70

1

To left-justify output in C++, use the ____ manipulator.

Select one of the following:

  • setcolumn

  • left

  • justify

  • setleft

Explanation

Question 29 of 70

1

A ____ is an area in secondary storage used to hold information.

Select one of the following:

  • member

  • file

  • sector

  • variable

Explanation

Question 30 of 70

1

You can use the ____ function to restore an input stream to a working state.

Select one of the following:

  • clear

  • flush

  • init

  • ignore

Explanation

Question 31 of 70

1

Which of the following is NOT a reserved word in C++?

Select one of the following:

  • break

  • case

  • select

  • default

Explanation

Question 32 of 70

1

You can use either a(n) ___ variable or a bool variable to store the value of a logical expression.

Select one of the following:

  • float

  • int

  • string

  • double

Explanation

Question 33 of 70

1

When using a return statement, the return of any value other than ____ indicates that something went wrong during program execution.

Select one of the following:

  • 1

  • 0

  • -1

  • eof

Explanation

Question 34 of 70

1

To permit more than one statement to execute if an expression evaluates to true, C++ provides a structure called a ____ statement.

Select one of the following:

  • switch

  • one-way selection

  • compound

  • two-way selection

Explanation

Question 35 of 70

1

When C++ evaluates a logical expression, any nonzero value is treated as _____.

Select one of the following:

  • a logical error

  • a syntax error

  • false

  • true

Explanation

Question 36 of 70

1

In ____ evaluation, the computer evaluates a logical expression from left to right and stops as soon as the value of the expression is known.

Select one of the following:

  • conditional

  • decision maker

  • short-circuit

  • associative

Explanation

Question 37 of 70

1

Which of the following expressions evaluates to true?

Select one of the following:

  • (14 >= 5) && ('A' < 'B')

  • !('A' < 'B')

  • !(6 <= 7)

  • (24 >= 35) && ('A' < 'B')

Explanation

Question 38 of 70

1

Which of the following expressions evaluates to true?

Select one of the following:

  • "Hello" = "hello"

  • "Bill" >= "Billy"

  • "Hello" > "Hi"

  • "Air" < "An"

Explanation

Question 39 of 70

1

Given the input stream variable cin, the expression ____ evaluates to true if the last input succeeded.

Select one of the following:

  • (cin = 1)

  • (cin <<)

  • (cin)

  • (cin == 0)

Explanation

Question 40 of 70

1

If the possible range of values for a multiple selection statement cannot be reduced to a finite set of values, you must use the ____ structure.

Select one of the following:

  • nested if

  • if

  • switch

  • if ... else

Explanation

Question 41 of 70

1

The function time is defined in the header file ____.

Select one of the following:

  • cstdlib

  • ctime

  • cmath

  • iomanip

Explanation

Question 42 of 70

1

Which of the following is the general form of the do...while statement?

Select one of the following:

  • do statement while (expression);

  • do (statement); while expression

  • do while statement (expression);

  • do expression while (statement);

Explanation

Question 43 of 70

1

Putting one control structure inside another is called ____.

Select one of the following:

  • looping

  • indexing

  • sequencing

  • nesting

Explanation

Question 44 of 70

1

The C++ eof function is a member of the data type ____.

Select one of the following:

  • iomanip

  • istream

  • cstdlib

  • file

Explanation

Question 45 of 70

1

The function rand() is defined in the header file ____.

Select one of the following:

  • iostream

  • iomanip

  • cstdlib

  • cmath

Explanation

Question 46 of 70

1

When the ____ statement executes in a repetition structure, it immediately exits from the structure.

Select one of the following:

  • continue

  • exit

  • do

  • break

Explanation

Question 47 of 70

1

A _____ is a special value that marks the end of the input data.

Select one of the following:

  • trigger

  • switch

  • sentinel

  • constant

Explanation

Question 48 of 70

1

The _____ statement is an effective way to avoid extra variables to control a loop and produce elegant code.

Select one of the following:

  • break

  • switch

  • continue

  • skip

Explanation

Question 49 of 70

1

The _____ loop is a pretest loop.

Select one of the following:

  • indexed

  • while

  • switch

  • do...while

Explanation

Question 50 of 70

1

The primary purpose of the ____ loop is to simplify the writing of counter-controlled loops.

Select one of the following:

  • sentinel

  • do-while

  • nested

  • for

Explanation

Question 51 of 70

1

The heading of a function includes all of the following EXCEPT the ____.

Select one of the following:

  • number of parameters

  • data type of the parameters

  • data type of the return value

  • code required to accomplish the task

Explanation

Question 52 of 70

1

A variable for which memory is allocated at block entry and deallocated at block exit is called a(n) _____ variable.

Select one of the following:

  • static

  • identification

  • unique

  • automatic

Explanation

Question 53 of 70

1

A ____ parameter is a formal parameter that receives the location (memory address) of the corresponding actual parameter.

Select one of the following:

  • static

  • memory

  • value

  • reference

Explanation

Question 54 of 70

1

Which of the following statements is FALSE?

Select one of the following:

  • Default values can be constants, global variables, or function calls.

  • If you do not specify the value of a default parameter, the default value is used for that parameter.

  • You can assign a constant value as a default value to a reference parameter.

  • The calling function has the option of specifying a value other than the default for any default parameter.

Explanation

Question 55 of 70

1

The C++ function pow has ____ parameters.

Select one of the following:

  • zero

  • three

  • one

  • two

Explanation

Question 56 of 70

1

The _____ of an identifier refers to where in the program an identifier is accessible.

Select one of the following:

  • parameter

  • behavior

  • scope

  • definition

Explanation

Question 57 of 70

1

If a function is overloaded, then in a call to that function, the _____ determines which function to execute.

Select one of the following:

  • scope

  • declaration

  • definition

  • signature

Explanation

Question 58 of 70

1

The C++ function ____ calculates the largest whole number that is less than or equal to x.

Select one of the following:

  • ceil(x)

  • floor(x)

  • abs(x)

  • eqwhole(x)

Explanation

Question 59 of 70

1

____ parameters provide a one-way link between actual parameters and formal parameters.

Select one of the following:

  • Reference

  • Global

  • Static

  • Value

Explanation

Question 60 of 70

1

In C++, :: is called the scope ____ operator.

Select one of the following:

  • identity

  • comparison

  • equivalent

  • resolution

Explanation

Question 61 of 70

1

In C++, [ ] is called the _____ operator.

Select one of the following:

  • array subscript

  • character

  • array

  • array index

Explanation

Question 62 of 70

1

You can use the ____ operator to increment or decrement the value of an enumeration type.

Select one of the following:

  • assignment

  • scope resolution

  • stream

  • cast

Explanation

Question 63 of 70

1

You can access an individual character within a string using the array subscript operator together with the ____.

Select one of the following:

  • value of the character in single quotes

  • position of the character in the string

  • the integer equivalent of the character value

  • value of the character in double quotes

Explanation

Question 64 of 70

1

If a global identifier in a program has the same name as a global identifier in an included header file, the ____.

Select one of the following:

  • compiler automatically generates a new name for the global identifier in the program

  • compiler generates a syntax error

  • global identifier in the program overrides the global identifier in the header file

  • global identifier in the header file overrides the global identifier in the program

Explanation

Question 65 of 70

1

The operator ____ can be used to concatenate two values of type string.

Select one of the following:

  • &

  • ::

  • +

  • -

Explanation

Question 66 of 70

1

Before using the data type string, the program must use which of the following statements to include the header file?

Select one of the following:

  • #include (cstring)

  • include <#string>

  • #include <cstring>

  • #include <string>

Explanation

Question 67 of 70

1

The ____ function is used to interchange the contents of two string variables.

Select one of the following:

  • substr

  • switch

  • swap

  • change

Explanation

Question 68 of 70

1

The enumeration type is a(n) ____ type.

Select one of the following:

  • integral

  • string

  • Boolean

  • character

Explanation

Question 69 of 70

1

The values that you specify for an enumeration type must be _____.

Select one of the following:

  • identifiers

  • sorted

  • reserved words

  • true or false

Explanation

Question 70 of 70

1

An enumeration type is a set of ____ values.

Select one of the following:

  • constant

  • ordered

  • unordered

  • anonymous

Explanation