Question: 1... How many times will the Bird class default constructor be called in the following declarations: Bird Parrot[5]; Select one: a. 0 b. 1 c.
1...
How many times will the Bird class default constructor be called in the following declarations:
Bird Parrot[5];
Select one:
a. 0
b. 1
c. 5
d. 6
2...
Which of the follow will NOT cause double change = 0; to output 0.00?
Select one:
a. cout << fixed << setprecision(2) << change;
b. cout << setprecision(3) << change;
c. cout << showpoint << setprecision(3) << change;
d. All of the above cause output to be 0.00.
3....
What is the output of the last cout statement in the following code, assuming the user first enters Travis then presses enter, then enters The grass is always greener then presses enter.
int main() {
string name;
string favQuote;
cout << "Enter your name: ";
getline(cin, name);
cout << "Enter your favorite quote: ";
cin >> favQuote;
cout << name << " likes the quote: " << favQuote;
return 0;
}
Select one:
a. Travis likes the quote: The
b. Travis likes the quote: The grass is always greener
c. The grass is always greener likes the quote: Travis
d. No output. Error in code.
4.....
Which of the following is the declaration of a vector called person of type height which is a struct with two integer data members ft and in?
Select one:
a. vector
b. vector
c. vector
d. height
5...
Which of the following declares a variable person of struct type height?
Select one:
a. person height;
b. height person;
c. height
d. struct person height;
6....
Which of the following defines the default constructor for the class Schedule?
Select one:
a. Schedule::Schedule() { /* Function code */ }
b. void Schedule() { /* Function code */ }
c. Schedule->Schedule() { /* Function code */ }
d. Schedule() { /* Function code */ }
7....
Which preprocessor directive prevents a file from being included multiple times?
Select one:
a. #ifndef
b. #include
c. #define
d. #guard
8...
Which of the following lines contains a syntax error?
int main() {
ostringstream ageOSS;
int myAge = 22;
ageOSS << I am << myAge << years old.;
cout << ageOSS.str();
return 0;
}
Select one:
a. ostringstream ageOSS;
b. ageOSS << I am << myAge << years old.;
c. cout << ageOSS.str();
d. None of the above.
9....
What is the output of the following code given the program was called using the command-line:
a.out infile.txt outfile.txt auxfile.dat
int main(int argc, char* argv[]) {
cout << argv[2];
return 0;
}
Select one:
a. infile.txt
b. outfile.txt
c. infile.txt outfile.txt auxfile.dat
d. None of the above.
10.....
Which of the following will attempt to open the file output_file.txt stored in the string myfile using the ofstream outFS?
Select one:
a. ofstream.open(output_file.txt);
b. outFS.open(myfile.c_str());
c. myfile.open(outFS);
d. outFS.open(output_file.txt);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
