1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
alexdok [17]
4 years ago
9

If the object instance is created in a user program, then the object instance can access both the public and private members of

the class using DOT notation (such as Rectangle r; r.area=10). True or False
Computers and Technology
1 answer:
rewona [7]4 years ago
5 0

Answer:

False

Explanation:

The private member of a class is not accessible by using the Dot notation ,however the private member are those which are not accessible inside the class they are accessible outside the class  .The public member are accessible inside the class so they are accessible by using the dot operator .

<u>Following are the example is given below in C++ Language </u>

#include<iostream>   // header file

using namespace std;  

class Rectangle

{    

   private:  

       double r; // private member  

   public:      

       double  area()  

       {     return 3.14*r*r;  

       }        

};  

int main()  

{    

  Rectangle r1;// creating the object  

   r1.r = 3.5;  

 double t= r1.area(); // calling

cout<<" Area is:"<<t;  

   return 0;  

}  

Output:

compile time error is generated

<u>The correct program to access the private member of class is given below </u>

#include<iostream>   // header file

using namespace std;  

class Rectangle

{    

   private:  

       double r; // private member  

   public:      

       double  area()  

       {    

r1=r;

double t2=3.14*r2*r2;

return(t2); // return the value  

       }        

};  

int main()  

{    

  Rectangle r1;// creating the object  

   r1.r = 1.5;  

 double t= r1.area(); // calling

cout<<" Area is:"<<t;  

   return 0;  

}  

Therefore the given statement is False

You might be interested in
Which of the following is an example of an output device on a smartphone?
Andru [333]

Answer:

The speaker

Explanation:

Speakers are output devices because the audio is taken from the app or website and playing it towards the speakers.

7 0
3 years ago
Which of the following types of tool should be used only on round work, such as rigid or IMC conduit?
Dafna11 [192]
Its C. A pipe wrench 
6 0
3 years ago
Read 2 more answers
What is computer hadware​
Alex Ar [27]

Answer: like the monitor or the keyboard

Explanation: it is true i even looked it up and it was true

8 0
2 years ago
Which of the following is used by a seller to deceive a buyer? a. bait and switch b. contest c. display d. introductory offer
notka56 [123]
The answer to this question is A. bait and switch.
4 0
4 years ago
Read 2 more answers
what do you do if someone you really love reads your message and doesnt reply? do I text them again or just ignore it?
crimeas [40]
If you really love someone and you text them but they don't text you back. You let it go because they aren't interested. I am sorry for saying that, but it could also mean that they are doing something at the moment and can't text back. I say, give it a day and if they don't text back, don't bother texting back.

3 0
3 years ago
Other questions:
  • Help 30 points I will mark brainliest!!!!!!!!!!!
    10·1 answer
  • The smallest unit of time in music called?
    6·2 answers
  • What is ATX full size motherboard? Tell its size as well?
    14·1 answer
  • When you receive five job offers what does it mean
    9·1 answer
  • If a driver who is under the age of 21 is stopped by a law enforcement officer and has a blood alcohol level of 0.02 or greater
    8·1 answer
  • Which is an internet service? <br> A.) antivirus <br> B.) chat <br> C.) firewall<br> D.) router
    6·2 answers
  • _____ creates a border or space that separates information.
    14·1 answer
  • In this lab you are asked to declare two variables of type integer: userNum and x. The user should input should be stored using
    8·1 answer
  • Special variables that hold copies of function arguments are called _________.
    11·1 answer
  • When entering a expressway using a weave lane you must do what
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!