C++

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

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

#include directive

What is the value stored at x, given the statements: int x; x = 3 / static_cast<int>(4.5 + 6.4);

0

What is the output of the following statement? cout << 4 + 8;

12

In the following C++ statement, what will be executed first according to the order of precedence. result = 6 - 3 * 2 + 7 - 10 / 2 ;

3 * 2

What is the value of number after the following statements execute? int number = 10; number += 5; number -= 2; number *= 3;

39

Which line in the following program will cause a compiler error? 1 #include <iostream> 2 using namespace std; 3 4 int main() 5 { 6 const int MY_VAL = 77; 7 MY_VAL = 99; 8 cout << MY_VAL << endl; 9 return 0; 10 }

7

How many characters does the string, "John Doe" require so it can be stored in memory properly?

9

The ______ operator always follows the cin object, and the ______ operator follows the cout object.

>>, <<

An Integrated Development Environment typically consists of:

A text editor

What statement best describes a variable and its primary purpose?

A variable is a named storage location in the computer's memory used for holding a piece of information.

Which of the following best describes an operator?

An operator allows you to perform operations on one or more pieces of data

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

Closing brace

_______________ are used to translate each source code instruction into the appropriate machine language instruction.

Compilers

The character array company[12] can hold

Eleven characters and the null terminator

During which stage does the central processing unit retrieve from main memory the next instruction in the sequence of program instructions?

Fetch

Which is true about the following statement? cout << setw(4) << num4 << " ";

It allows four spaces for the value in the variable num4.

Words that have a special meaning and may be used only for their intended purpose are known as:

Key Words

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

A statement that starts with a # is called a:

Preprocessor directive

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

Semicolon

The statements written by the programmer are called:

Source code

This is a complete instruction that causes the computer to perform some action.

Statement

In programming terms, a group of characters inside a set of quotation marks is called a:

String literal

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

The beginning of a comment

When the final value of an expression is assigned to a variable, it will be converted to:

The data type of the variable

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

The header file iostream

What does the term hardware refer to?

The physical components that a computer is made of

A variable declaration announces the name of a variable that will be used in a program, as well as:

The type of data it will be used to hold

_____________ represent storage locations in the computer's memory.

Variables

Which character signifies the beginning of an escape sequence?

\

To write data to a file, you define an object of this data type.

ofstream

This manipulator is used to establish a field width for the value immediately following it.

setw

A variable whose value can be either true or false is of this data type.

bool

If you are reading data from a keyboard and you wanted the computer to recognize the space, tab, or Enter key as the delimiter to separate two input values, you would use the _______ object.

cin

You want the user to enter the length, width, and height from the keyboard. Which cin statement is correctly written?

cin >> length >> width >> height;

Which statement will read a string into the following char array? char names[20];

cin >> names;

The _________ causes a program to wait until information is typed at the keyboard and the Enter key is pressed.

cin object

This reads an entire line of text, until the [Enter] key is pressed.

cin.getline()

The function, pow(x, 5.0), requires this header file.

cmath

The ______ is/are used to display information on the computer's screen

cout object

This stream manipulator forces cout to print the digits in fixed-point notation.

fixed

To allow file access in a program, you must #include this header file.

fstream

The numeric data types in C++ can be broken into two general categories:

integer and floating point

In any program that uses the cin object, you must include the ___________.

iostream header file


संबंधित स्टडी सेट्स

AP Language Chapter 2 Terms w/ Examples

View Set

TestOut PC Pro: 1.2 Hardware Basics

View Set

Operations Management Final Exam Practice Problems

View Set

Microeconomics Exam #1 Test Review

View Set

Before eating lunch, you should wash your hands. (DGP 22)

View Set

Nature of Lang Quiz 6 - Morphology

View Set

College American History ch.11-12

View Set