CS 150 Chapter 2

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

alpha = beta; beta = beta + 1;

Suppose that alpha and beta are int variables. The statement alpha = beta++; is equivalent to the statement(s) ____.

True

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

double

An example of a floating point data type is ____.

Sunny Day

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

alpha = beta; beta = beta - 1;

Suppose that alpha and beta are int variables. The statement alpha = beta--; is equivalent to the statement(s) ____.

False

A comma is also called a statement terminator.

simple

A data type is called ____________________ if the variable or named constant of that type can store only one value at a time.

whitespaces or whitespace or white spaces or white space

In a C++ program, ____________________ are used to separate special symbols, reserved words, and identifiers.

True

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

variable

A(n) ____________________ is a memory location whose contents can be changed.

string

A(n) ____________________ is a sequence of zero or more characters.

False

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

Insertion Point 1

Consider the following code. // Insertion Point 1 using namespace std; const float PI = 3.14; int main() { //Insertion Point 2 float r = 2.0; float area; area = PI * r * r; cout << "Area = " << area <<endl; return 0; } // Insertion Point 3 In this code, where does the include statement belong?

True

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

False

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

named constant or constant

In C++, you can use a(n) ____________________ to instruct a program to mark those memory locations in which data is fixed throughout program execution.

one = 10.5, two = 30.6

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

implicit

When a value of one data type is automatically changed to another data type, a(n) ____________________ type coercion is said to have occurred.

alpha = 50

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

beta = beta + 1; alpha = beta;

Suppose that alpha and beta are int variables. The statement alpha = ++beta; is equivalent to the statement(s) ____.

beta = beta - 1; alpha = beta;

Suppose that alpha and beta are int variables. The statement alpha = --beta; is equivalent to the statement(s) ____.

2

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

sum = 15

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

syntax

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

enumeration

The ____________________ type is C++ 's method for allowing programmers to create their own simple data types.

False

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

13

The expression static_cast<int>(6.9) + static_cast<int>(7.9) evaluates to

9

The expression static_cast<int>(9.9) evaluates to ____.

16

The length of the string "computer science" is ____.

True

The maximum number of significant digits in float values is up to 6 or 7.

four

The memory allocated for a float value is ____ bytes.

token

The smallest individual unit of a program written in any language is called a(n) ____________________.

3

The value of the expression 17 % 7 is ____.

3

The value of the expression 33/10, assuming both values are integral data types, is ____.

program_1 (not program! 1program program )

Which of the following is a legal identifier?

char

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

\n

Which of the following is the newline character?

Prompt lines

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

'A'

____ is a valid char value.

46259 (not 46,259 462.59 -32.00)

____ is a valid int value.

Semantic or semantic

____________________ rules determine the meaning of instructions.

False

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

True

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

precision

The maximum number of significant digits is called the ____________________.

long long

The memory space for a(n) ____________________ data value is 64 bytes.

int a,b,c;

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

subprogram or sub program or sub-program or function or modlue

A(n) ____________________ is a collection of statements, and when it is activated, or executed, it accomplishes something.

Comments or comments

____________________ can be used to identify the authors of the program, give the date when the program is written or modified, give a brief explanation of the program, and explain the meaning of key statements in a program.

Predefined or predefined or Standard or standard

____________________ functions are those that have already been written and are provided as part of the system.

Programming or programming

____________________ is the process of planning and creating a program.


Kaugnay na mga set ng pag-aaral

Finding Slope/Y-Int. from Standard and Slope-Intercept Form

View Set

Chapter 8 - Supporting Your IdeasAssignment

View Set

Chapter Exam: Georgia Laws and Rules

View Set

ATI Pharm Made Easy Cardiovascular System

View Set