C++ Early Objects Ch.2

C++ Early Objects Ch.2

memorize.aimemorize.ai (lvl 286)
Section 1

Preview this deck

What literal(s) appear in the following C++ statement? int number = 4 + 8;

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 14, 2020

Cards (20)

Section 1

(20 cards)

What literal(s) appear in the following C++ statement? int number = 4 + 8;

Front

Both 4 and 8

Back

Which of the following is/are valid C++ identifiers?

Front

Both department_9 and aVeryLongVariableName, but not last-name

Back

Bool

Front

A ___ variable can hold only one of two values

Back

the expression 7 / 2 evaluates to

Front

3

Back

Which of the following definitions will allow the variable average to hold floating-point values?

Front

float average; double average; auto average= 0.0;

Back

Which of the following keywords is/are the names of C++ data types?

Front

short long double bool

Back

Every C++ program must have

Front

a function called main

Back

String Literal

Front

In programming terms, a group of characters inside a set of double quotation marks (" ") is called

Back

What value will be assigned to the variable number by the following statement? int number = 3.75;

Front

3

Back

The expression 7 % 2 evaluates to

Front

1

Back

True/False: The following two statements both assign the value 5 to the variable dept. 5 = dept; dept = 5;

Front

False

Back

True/False: The following is a legal C++ statement to define and initialize a variable. char firstName = "Jack";

Front

False

Back

A variable must be defined

Front

in order to perform output

Back

True/False: The following two statements could be used interchangeably in a C++ program. //Program Payroll / Program Payroll /

Front

True

Back

The iostream header file

Front

___ must be included in a program in order to use the cout object.

Back

Assignment

Front

An operation that copies a value into a variable is called a(n) ___ operation.

Back

True/False: The following statements both declare the variable num to be an integer. int num; INT num;

Front

False

Back

Which of the following will cause the next output to begin on a new line?

Front

cout << endl;

Back

Semicolon

Front

A ___ is used to mark the end of a complete C++ programming statement.

Back

True/False: If a variable is defined as int sum; it may be written in the program code as sum or Sum, but not SUM.

Front

False

Back