Computer Programming: Chapter 2

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

The _______ causes the contents of another file to be inserted into a program.

#include directive

What is the modulus operator?

%

Character constraints in C++ are always inclosed in ______.

'single quotations marks'

Escape sequences are always stored internally as a single character.

True

For every opening brace in a C++ program, there must be a:

closing brace

What will the following code display? cout << "Four\n" << "score\n"; cout << "and" << "\nseven"; cout << "\nyears" << " ago" << endl;

Four score and seven years ago

What will the following Code Display cout << "Four" << "score" << endl; cout << "and" << "seven" << endl; cout << "years" << "ago" << endl;

Fourscore andseven yearsago

Which of the following defines a double-precision floating point variable named payCheck?

double payCheck;

How would you consolidate the following declaration statements into one statement? int x = 7; int y = 16; int z = 28;

int x = 7, y = 16, z = 28;

The float data type is considered _____ precision, and the double data type is considered ______ precision.

single, double

The first step in using the string class is to #include the ___________ header file.

string

In a C++ program, two slash marks (//) indicate:

The beginning of a comment

________ must be included in any program that uses the cout object.

The header file iostream

What will the following code display? int number = 7; cout << "The number is " << "number" << endl;

The number is number

In the C++ instruction, cookies = number % children; given the following declaration statement: int number = 38, children = 4, cookies; what is the value of cookies after the execution of the statement?

2

What will the value of x be after the following statements execute? int x; x = 18 % 4;

2

Which one of the following would be an illegal variable name?

3dGraph

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

A semicolon

These are data items whose values do not change while the program is running.

Literals

In memory, C++ automatically places a ___________ at the end of string literals.

Null terminator

When typing in your source code into the computer, you must be very careful since most of your C++ instructions, header files, and variable names are case sensitive.

True


Conjuntos de estudio relacionados

AP Psych Ch 5 Practice questions

View Set

Fundamentals Midterm sp21 wk1-9 practice

View Set

XCEL Chapter 2: Nature of Insurance, Risk, Perils, and Hazards

View Set

Chapter 9 Senses: Seeing and Hearing

View Set

Structured Programming Week 13: Recursion

View Set

Pharm 5: Administering Injections

View Set