CH.2 - C++ Programming

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

Insertion Point 1 alpha =

beta; beta = beta + 1;

The memory allocated for a float value is ____ bytes.

four

Which of the following is a legal identifier?

program_1

____ are executable statements that inform the user what to do.

prompt lines

Suppose that sum and num are int variables and sum = 5 and num = 10. After the statement sum += num executes, ____.

sum = 15

A comma is also called a statement terminator.

F

A mixed arithmetic expression contains all operands of the same type.

F

An operator that has only one operand is called a unique operator.

F

In C++, reserved words are the same as predefined identifiers.

F

The escape sequence \r moves the insertion point to the beginning of the next line.

F

____ is a valid char value.

'A'

The expression static_cast(6.9) + static_cast(7.9) evaluates to ____.

13

The length of the string "computer science" is ____. Question 22 options:

16

Suppose that count is an int variable and count = 1. After the statement count++; executes, the value of count is ____.

2

(2X) The value of the expression 33/10, assuming both values are integral data types, is ____. // The value of the expression 17 % 7 is ____.

3

Choose the output of the following C++ statement: cout << "Sunny " << '\n' << "Day " << endl;

Sunny Day

The ____ rules of a programming language tell you which statements are legal, or accepted by the programming language.

Syntax

If a C++ arithmetic expression has no parentheses, operators are evaluated from left to right.

T

Suppose a = 5. After the execution of the statement ++a; the value of a is 6.

T

Suppose that sum is an int variable. The statement sum += 7; is equivalent to the statement sum = sum + 7;

T

The maximum number of significant digits in FLOAT VALUES is up to 6 or 7.

T

The maximum number of significant digits in values of the DOUBLE type is 15.

T

____ is a valid int value.

46259

The expression static_cast(9.9) evaluates to ____

9

Which of the following is the newline character?

\n

Suppose that alpha and beta are int variables and alpha = 5 and beta = 10. After the statement alpha *= beta; executes, ____.

alpha = 50

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

char

An example of a floating point data type is ____

double

The declaration int a, b, c; is equivalent to which of the following?

int a,b,c;

In a C++ program, one and two are double variables and input values are 10.5 and 30.6. After the statement cin >> one >> two; executes, ____.

one = 10.5, two = 30.6


Conjuntos de estudio relacionados

Define motor unit, twitch vs. tetanic contraction, isotonic vs. isometric contractions. Describe the two types of isotonic contractions.

View Set

Chapter 11: Small Business Pricing, Distribution, and Location

View Set

AP Gov Unit 2 Vocabulary (Interactions Among Branches of Government)

View Set

Fundamentals of Nursing III (Chap 39 Fluid, Electrolyte, and Acid-Base Balance Prep U)

View Set

Chapter 20 - Configuring and Using Web Browsers

View Set