A variable of a class data type is known as a(n) A) client B) specification C) c
ID: 3796801 • Letter: A
Question
A variable of a class data type is known as a(n) A) client B) specification C) constant D) object E) None of the answers provided In this course, the code that implements class member functions is found in which location? A) specification file B) implementation file C) client program file D) None of the answers provided What code has access to a private variable that has Class Scope? A) The private variable is only accessible to code within the class constructor B) The private variable is only accessible to code within the class private member functions C) The private variable is accessible to all code within the program D) The private variable is accessible to all code within the class E) None of the answers provided Suppose derived class B inherits from base class A. In what order are the constructors and destructors for the following code segment execute if the int variable x has value 5? If (x > 0) {B bb; ...} A) B constructor, A constructor, B destructor, A destructor B) A constructor, B constructor, A destructor, B destructor C) A constructor, B constructor, B destructor, A destructor D) B constructor, A constructor, A destructor, B destructor E) None of the answers provided Assume that we have a Shape base class and derived classes Triangle, Circle, and Rectangle Which of the following member functions should be virtual? A) perimeter ()//returns perimeter B) Shape ()//initializes shape object C) area ()//returns area D) Both (A) and (C) E) Both (B) and (C) ABC) None of the answers providedExplanation / Answer
============================================================
01.
-----------
Answer:
-----------
D)Object
-----------
Explanation:
-----------
Any variable of class data type called as object of the associated class type.
For example Traingle t;
here t indicates object of type Traingle
============================================================
02.
-----------
Answer:
-----------
B) implementation file
-----------
Explanation:
-----------
All class member functions are present in implementation file
============================================================
03.
-----------
Answer:
-----------
D)The private variable is accessible to all code within the class
-----------
Explanation:
-----------
Any variable which is declare as private are accessible within the class only.
============================================================
04.
-----------
Answer:
-----------
A) A constructor, B constructor, A destructor, B destructor
-----------
Explanation:
-----------
In the given code if(x>0)
{
B bb;
}
int x value first assigned by A constructor and followed by B constructor
next A destructor and followed by B destructor
============================================================
05.
-----------
Answer:
-----------
D)Both (A) and (C)
-----------
Explanation:
-----------
perimeter() and area() are the virtual functions in Shape class , since Shape class does not have any calculation part
The derived classes Traingle, Circle and Rectangle will provide the implementation for the given functions
============================================================
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.