7. Assuming that an operator overload for the stream extraction operator is created for class Planet and is also a member function of that class; assume that p is defined as an object of type Planet. What would the correct syntax be to input p? a. cin >> p; b. p >> cin; c. cin >> Planet p; d. Planet.cin >> p; 8. The ofstream class provides a fail() function to determine if the last attempt to write to a file failed. a. True b. False 9. To close a file once a function is done reading or writing to it, the program can a. Call the close function on the object b. Wait for the object to go out of scope and let the objects destructor close the file C. a and b are correct d. None of the above 10. A destructor is a a. Member function that is automatically called when an object of the class/struct type goes out of scope b. Must be declared publicly c. Both a and b d. None of the above 11. When a class dynamically allocates memory using new, a destructor is not necessarily required as the memory will be deallocated when an object of that class goes out of scope. a. True b. False 12. A type of member function that is intended to be overloaded in a derived class is a a. Template function b. Friend function c. Virtual function d. Inline function 13. Which of the following is true of an abstract base class a. An object cannot be instantiated of an abstract base class type b. It contains one more pure virtual functions c. It is intended strictly as a template to derive other classes d. All of the above

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
7. Assuming that an operator overload for the stream extraction operator is
created for class Planet and is also a member function of that class; assume
that p is defined as an object of type Planet. What would the correct syntax
be to input p?
a.
b.
c.
cin >> Planet p;
d. Planet.cin >> p;
cin >> p;
p >> cin;
8. The ofstream class provides a fail() function to determine if the last attempt
to write to a file failed.
a. True
b. False
9. To close a file once a function is done reading or writing to it, the program
can
a. Call the close function on the object
b.
Wait for the object to go out of scope and let the objects destructor
close the file
C.
d.
a and b are correct
None of the above
10. A destructor is a
a. Member function that is automatically called when an object of the
class/struct type goes out of scope
Must be declared publicly
b.
c. Both a and b
d. None of the above
11. When a class dynamically allocates memory using new, a destructor is not
necessarily required as the memory will be deallocated when an object of
that class goes out of scope.
a. True
b. False
12. A type of member function that is intended to be overloaded a derived
class is a
a. Template function
b. Friend function
c. Virtual function
Inline function
d.
13. Which of the following is true of an abstract base class
a. An object cannot be instantiated of an abstract base class type
b. It contains one more pure virtual functions
c. It is intended strictly as a template to derive other classes
d. All of the above
Transcribed Image Text:7. Assuming that an operator overload for the stream extraction operator is created for class Planet and is also a member function of that class; assume that p is defined as an object of type Planet. What would the correct syntax be to input p? a. b. c. cin >> Planet p; d. Planet.cin >> p; cin >> p; p >> cin; 8. The ofstream class provides a fail() function to determine if the last attempt to write to a file failed. a. True b. False 9. To close a file once a function is done reading or writing to it, the program can a. Call the close function on the object b. Wait for the object to go out of scope and let the objects destructor close the file C. d. a and b are correct None of the above 10. A destructor is a a. Member function that is automatically called when an object of the class/struct type goes out of scope Must be declared publicly b. c. Both a and b d. None of the above 11. When a class dynamically allocates memory using new, a destructor is not necessarily required as the memory will be deallocated when an object of that class goes out of scope. a. True b. False 12. A type of member function that is intended to be overloaded a derived class is a a. Template function b. Friend function c. Virtual function Inline function d. 13. Which of the following is true of an abstract base class a. An object cannot be instantiated of an abstract base class type b. It contains one more pure virtual functions c. It is intended strictly as a template to derive other classes d. All of the above
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education