COP2000 Quiz 2 Chapter 2

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

The C++ language requires that you give variables names that indicate what the variables are used for.

False

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

Four score and seven years ago

Besides decimal, two other number systems you might encounter in C++ programs are:

Hexadecimal and Octal

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

Literals

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

Semicolon

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

The beginning of a comment

C++ does not have a built in data type for storing strings of characters.

True

Escape sequences are always stored internally as a single character.

True

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

Every complete C++ program must have a _____________.

function named main

How would you consolidate the following declaration statements into one statement?

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 _____ causes the contents of another file to be inserted into a program.

#include directive

What is the modulus operator?

%

Character constants in C++ are always enclosed in ______.

'single quotation marks'

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

2

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

4

Of the following, which is a valid C++ identifier?

All of these are valid identifiers.


Ensembles d'études connexes

Lab 7: Retina, Macula and Fovea, Optic Disc and Optic Nerve

View Set

Lifespan Chap 32: Concepts of Care for Patients with Cardiac Problems

View Set

Combo of NY BAR Review cards by smjr1920

View Set

Chapter 26: EMT: Behavioral Emergencies Post study Questions

View Set

Chapter 29 The High-Risk Newborn: Problems Related to Gestational Age and Development

View Set

Public Speaking DE - Ch 12 Using Language

View Set

CWTS-6-Radio Frequency Fundamentals for Wireless LAN Technology

View Set