C++ Programming: From Problem Analysis to Program Design
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN: 9781337102087
Author: D. S. Malik
Publisher: Cengage Learning
Expert Solution & Answer
Book Icon
Chapter 13, Problem 1TF

Explanation of Solution

  1. Function that overloads an operator is called the operator function. Hence the statement is true.

  2. The operators that cannot be overloaded are- ., .*, ::, ?:, and sizeof. Hence the statement is false.

  3. In C++, operators cannot be redefined for built-in types but overloaded for user-defined types. Hence the statement is false.

  4. C++ does not allow users to create their own operators. Only built-in types can be overloaded. Hence the statement is false.

  5. Neither the precedence nor the associativityof an operator can be changed. Hence the statement is false.

  6. A friend function of a class is a non-member function of the classbut can access all the members of the class. Hence the statement is false.

  7. When writing the definition of a friend function, the keywordfriend must not appear in the function heading. The word friend appears only in the function prototype in the classdefinition, not in the definition of the friend function. Hence the statement is false.

  8. In C++, not all operators can be overloaded as member functions ofa class. The operators that cannot be overloaded are - ., .*, ::, ?:, and sizeof. Hence the statement is false.

  9. Every instance of an overloaded function has the same number ofparameters, as thenumber of parameters that the operator takes cannot be changed. Hence the statement is true.

  10. It is necessary to overload relational operators for any user defined class if any relational operation is required using that class, irrespective of its member variable types. Hence the statement is false.

  11. To distinguish between pre- and post-increment operator overloading, a dummy parameter (of type int) is used in the function heading of the operator function for the post-increment operator. Hence the statement is false.

  12. Templates provide the capability for software reuse by using the same logic or algorithm for multiple datatypes. Templates enables use of a single code segment for a set of relatedfunctions or classes. Hence the statement is true.

  13. The function members of a class template are considered function templates - when giving the definitions of the function members of a class template, the definition of the function template is to be followed. Hence the statement is true.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
in c++ , fix all bugs or mistakes in code and explain in comments what was wrong and how you fix it (there can be problems with semi-columns, curly braces, included libraries, wrong usage of functions, inproper conversion of datatypes and etc.) Comment all changes in code and show the output
Book: C++ Programming: From Problem Analysis to Program Design 8th edition, D. S. Malik In C++ In this programming exercise, you use abstract classes and pure virtual functions to design classes to manipulate various types of accounts. For simplicity, assume that the bank offers three types of accounts: savings, checking, and certificate of deposit, as described next. Savings accounts: Suppose that the bank offers two types of savings accounts: one that has no minimum balance and a lower interest rate and another that requires a minimum balance and has a higher interest rate. Checking accounts: Suppose that the bank offers three types of checking accounts: one with a monthly service charge, limited check writing, no minimum balance, and no interest; another with no monthly service charge, a minimum balance requirement, unlimited check writing, and lower interest; and a third with no monthly service charge, a higher minimum requirement, a higher interest rate, and unlimited check…
Question 4: What is function overriding? Write a sample code to demonstrate function overriding? Why is function overriding? Which keywords are used for function overriding? Question 5: With the help of C# code explain interfaces?
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education