CSCI 1380 Chapter 2

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

alpha = beta; beta = beta + 1;

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

alpha = beta; beta = beta - 1;

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

True

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

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.

True

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

four

The memory allocated for a float value is ____ bytes.

False

A comma is also called a statement terminator.

Sunny Day

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

False

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

double

An example of a floating point data type is ____.

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.

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

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

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

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

syntax

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

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

Which of the following is a legal identifier?

\n

Which of the following is the newline character?

'A'

____ is a valid char value.

46259

____ is a valid int value.


Set pelajaran terkait

Property Basics Practice Questions

View Set

The Mohs Scale of Hardness (Testing Properties of Rocks and Minerals)

View Set

What were the Causes of Imperialism?

View Set

Reading and Reporting Gram Stained Direct Smears

View Set

The Human Impact of the Chinese Exclusion Act

View Set

Chapter 30: Home Health and Hospice

View Set

Chapter 25: Assessment of Cardiovascular Function

View Set