C++ Ch 3 NEEDS REVISIONS

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

What is the value of result after the following statement executes?result = (3 * 5) % 4 + 24 / (15 - (7 - 4));

5

What is TRUE about the following statement? cout << setw(4) << num4 << " ";

It allows four spaces for the value in num4.

Which of the following functions will return the value of x, rounded to the nearest whole number?

round(x)

You can control the number of significant digits in your output with the ________ manipulator.

setprecision

This manipulator is used to establish a field width for the value that follows it:

setw

When C++ is working with an operator, it strives to convert operands to the same type. This is known as

type coercion

How many characters will the following statement read into the variable myString? cin >> setw(10) >> myString;

10

What is the value of cube after the following code executes? double cube, side; side = 5.0; cube = pow(side, 3.0);

125.0

What is the value of x after the following code executes? int x = 0; int y = 5; int z = 4; x = x + y + z * 2;

13

Which of the following will allow the user to input the values 15 and 20 and have them stored in variables named base and height, respectively?

cin >> base >> height;

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

cin object

Which of the following statements will allow the user to enter three values to be stored in variables length, width, and height, in that order?

cin.get(length, width, height);

To use the rand()function, you must include the ________ header file?

cstdlib

________ reads a line of input, including leading and embedded spaces, and stores it in a string object.

getline

A debugging process where you, the programmer, pretend you are a computer and step through each statement while recording the value of each variable at each step is known as

hand tracing

Which statement is equivalent to the following? number = number * 2;

number * = 2;


Set pelajaran terkait

Programming for Everybody - Python - Coursera (2nd Module)

View Set

CCNA Section 2 OSI Reference Model

View Set

Economies of Scale - Operations Management (P1)

View Set

Chapter 12, 13, 14, 26, and 27 Quizzes

View Set

FIN 221 Chapter 1 Intro Exercises

View Set

NET260.30 LINUX ADMINISTRATION Chapter 10

View Set

Pega CSSA Application Development

View Set

AIS Exam 2 (chapters 12-16), AIS CH13, Chapter 13, ais test 3

View Set