What is the purpose of flowcharting?
a. plan out the program before coding
b. Mr. Daniels likes pretty symbols
c. visual display of the program
d. all of the above
Answers for C++ Course using "Starting out with C++ : from control structures through objects" by Tony Gaddis. 7/8th ed. I used the Pearson myprogramminglab to complete the homework. Here are my solutions/answers for the exercises/labs so please use the test bank as a GUIDE if you're stuck. Let me know if you find a better solution to a problem or any of the programming challenges. Thanks in advance for your support! Send in missing programming challenges to cplusplus.answers@gmail.com
Showing posts with label Chapter 03. Show all posts
Showing posts with label Chapter 03. Show all posts
Chapter 3 Quiz Starting Out With C++ 039
How to you get a random number in C++?
a. x=rnd();
b. x=random();
c. x=rand();
d. x=randomNum();
a. x=rnd();
b. x=random();
c. x=rand();
d. x=randomNum();
Chapter 3 Quiz Starting Out With C++ 038
C++ has a runtime library for performing math?
a. True
b. False
a. True
b. False
Chapter 3 Quiz Starting Out With C++ 037
The cin.ignore function tells the cin object to skip one or more characters in the keyboard buffer.
a. True
b. False
a. True
b. False
Chapter 3 Quiz Starting Out With C++ 035
What does getline do?
a. reads an entire line including whitespaces
b. reads an entire line except whitespaces
c. a whole word
d. none of the above
a. reads an entire line including whitespaces
b. reads an entire line except whitespaces
c. a whole word
d. none of the above
Chapter 3 Quiz Starting Out With C++ 034
What are whitespace characters?
a. spaces
b. spaces and tabs only
c. spaces, tabs, or line breaks
d. none of the above
a. spaces
b. spaces and tabs only
c. spaces, tabs, or line breaks
d. none of the above
Chapter 3 Quiz Starting Out With C++ 033
Which of the following statements will display the following result if x is 123.4?
123.400
a. cout << setprecision(6) << showpoint << x << endl;
b. cout << setw(6) << x << endl;
c. cout << showpoint << x << endl;
d. cout << showpoint(3) << x << endl;
123.400
a. cout << setprecision(6) << showpoint << x << endl;
b. cout << setw(6) << x << endl;
c. cout << showpoint << x << endl;
d. cout << showpoint(3) << x << endl;
Chapter 3 Quiz Starting Out With C++ 032
What do you use to print digits in fixed-point notation or decimal?
a. setprecision
b. setw
c. fixedpoint
d. fixed
a. setprecision
b. setw
c. fixedpoint
d. fixed
Chapter 3 Quiz Starting Out With C++ 031
You can control the number of significant digits with which floating-point values are displayed by using the
a. setw
b. significant
c. setprecision
d. cast
a. setw
b. significant
c. setprecision
d. cast
Chapter 3 Quiz Starting Out With C++ 030
setw
a. sets the width of the screen
b. establishes print fields of a specified width
c. sets the precision of the variable
d. None of the above
a. sets the width of the screen
b. establishes print fields of a specified width
c. sets the precision of the variable
d. None of the above
Chapter 3 Quiz Starting Out With C++ 029
_____ provides a way to output data and _____ allows for input of data
a. cin, cout
b. input, output
c. cout, cin
d. output, input
a. cin, cout
b. input, output
c. cout, cin
d. output, input
Chapter 3 Quiz Starting Out With C++ 028
Will the following produce the same result?
x *= 5 x = x * 5
a. True
b. False
x *= 5 x = x * 5
a. True
b. False
Chapter 3 Quiz Starting Out With C++ 027
What does the value of x in the code fragment below?
c = 5;
x = 5 * (c++);
a. 6
b. 25
c. 30
d. 0 (since c++ has not been defined
c = 5;
x = 5 * (c++);
a. 6
b. 25
c. 30
d. 0 (since c++ has not been defined
Chapter 3 Quiz Starting Out With C++ 026
Is the following a valid assignment?
x = y = z = 10;
a. True
b. False
x = y = z = 10;
a. True
b. False
Chapter 3 Quiz Starting Out With C++ 024
What is type casting in C++
a. manually promoting or demoting a value
b. forcing an integer to hold a double or float
c. making it possible to add two different type variables to be added
d. None of the above
a. manually promoting or demoting a value
b. forcing an integer to hold a double or float
c. making it possible to add two different type variables to be added
d. None of the above
Chapter 3 Quiz Starting Out With C++ 023
What is an Overflow
a. When you try to use a value larger the the data type of the variable
b. When the computer runs out of memory
c. When a variable is uninitialized
d. None of the above
a. When you try to use a value larger the the data type of the variable
b. When the computer runs out of memory
c. When a variable is uninitialized
d. None of the above
Chapter 3 Quiz Starting Out With C++ 022
In C++, if you divide the integers 7 by 2 the answer will be
a. 3.5
b. 3
c. 2
d. undefined since the answer is a float
a. 3.5
b. 3
c. 2
d. undefined since the answer is a float
Chapter 3 Quiz Starting Out With C++ 021
When the final value of an expression is assigned to a variable, it will be converted
to the data type of that variable.
a. True
b. False
to the data type of that variable.
a. True
b. False
Subscribe to:
Posts (Atom)