Chapter 3 Quiz Starting Out With C++ 011

11) What is an expression in C++

a. An expression is how you declare a variable
b. An expression describes whether a variable has a value or not
c. An expression is a compiler command
d. An expression is a programming statement that has a value

Chapter 3 Quiz Starting Out With C++ 010

10) Can the cin object read in values of different types?

a. Yes, they must be all the same type
b. Yes, they can be different but separated by commas
c. Yes, only if the other type is a string
d. No, only one type.

Chapter 3 Quiz Starting Out With C++ 009

9) What key is pressed after the last input value using cin

a. TAB
b. ENTER
c. SPACE
d. DOWNARROW

Chapter 3 Quiz Starting Out With C++ 009

9) What key is pressed after the last input value when you are using cin?

a. TAB
b. ENTER
c. SPACE
d. DOWNARROW

Chapter 3 Quiz Starting Out With C++ 008

8) What file must you include to get cin to work?

a. cin.h
b. input
c. iostream
d. keyboard

Chapter 3 Quiz Starting Out With C++ 007

7) Can cin read in more than one value?

a. True
b. False

Chapter 3 Quiz Starting Out With C++ 006

6) >> is used for ____ and << is used for _____

a. input, output
b. output, input
c. cin, cout
d. cout, cin

Chapter 3 Quiz Starting Out With C++ 005

5) It is usually a good practice to display a prompt before gathering input

a. True
b. False

Chapter 3 Quiz Starting Out With C++ 004

4) What is the >> in C++

a. console standard input redirector
b. input funneling operator
c. stream extraction operator
d. all of the above

Chapter 3 Quiz Starting Out With C++ 003

3) How do you read in a value from the keyboard and assign it to variable number?

a. cin >> number;
b. cin << number;
c. cin > number;
d. cin < number;

Chapter 3 Quiz Starting Out With C++ 002

2) What is the standard input object in C++

a. cin
b. cout
c. readLine()
d. dataRead()

Chapter 3 Quiz Starting Out With C++ 001

1) How is input read in C++?

a. The cin object reads in input from the keyboard
b. The System.Console.Input function
c. Readline()
d. cin.dataRead()