a. Class definition and class implementation files are the same. b. Private members of the class can be directly accessed in the main() of the class. c. Functions cannot be written in the public section of the class.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter10: Classes And Data Abstraction
Section: Chapter Questions
Problem 6SA
icon
Related questions
icon
Concept explainers
Question

Answer the parts a b c 

First write whether statement is true or false then justify by giving reason that why is it true or false in 1 2 or 3 lines 

 

Q1. Justify the validity of the following statements with proper and logical
arguments.
a. Class definition and class implementation files are the same.
b. Private members of the class can be directly accessed in the main( ) of the
class.
c. Functions cannot be written in the public section of the class.
d. In accessor functions, value of any variable of the class cannot be
changed.
e. Namespace is a logical area, defining the scope of variables and functions.
In a same program, more than one namespace is not allowed.
f. Constructor functions are always declared as the mutator functions.
g. Scope resolution operator is used while declaring the functions in the class
interface.
h. A class must have a get_data( ) and print( ) function.
i. It is mandatory that the return type of the print( ) function in the class will
always be void.
j. getline( ) function can read a sequence of numbers declared as int.
Transcribed Image Text:Q1. Justify the validity of the following statements with proper and logical arguments. a. Class definition and class implementation files are the same. b. Private members of the class can be directly accessed in the main( ) of the class. c. Functions cannot be written in the public section of the class. d. In accessor functions, value of any variable of the class cannot be changed. e. Namespace is a logical area, defining the scope of variables and functions. In a same program, more than one namespace is not allowed. f. Constructor functions are always declared as the mutator functions. g. Scope resolution operator is used while declaring the functions in the class interface. h. A class must have a get_data( ) and print( ) function. i. It is mandatory that the return type of the print( ) function in the class will always be void. j. getline( ) function can read a sequence of numbers declared as int.
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Operators
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning