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]
3 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]3 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
_____ remove the part of an image starting from an edge​
Lapatulllka [165]
I think it’s cropping could be wrong though
4 0
3 years ago
A blue NFiPA label indicates: A) Health Hazard B) Special information C) Flammability D) Reactivity
elena55 [62]
Your answer would be A: Health Hazard
8 0
3 years ago
Read 2 more answers
How many report charts can be added to the account page layout to meet this requirement? A sales manager would like to look at a
Virty [35]

Answer:

D - 2

Explanation:

You can have two report charts per page. You can only add report charts from the enhanced page layout editor.

The mini console and the original page layout editor are not supported. On detail pages, users can refresh up to 100 report charts every 60 minutes. Your organization can refresh up to 3,000 report charts every 60 minutes

8 0
3 years ago
Trong ửod muốn trình bày dạng cột càn thực hiện lệnh nào
velikii [3]

Answer:

Tác dụng của phím tắt trong Word thì đã quá rõ ràng rồi, nó giúp bạn soạn thảo văn bản, căn chỉnh lề, kích thước, cắt, dán…. nhanh hơn rất nhiều, bạn càng nhớ nhiều phím tắt bao nhiêu thì càng tiện lợi bấy nhiêu.

Explanation:

3 0
3 years ago
What are the synonyms for each word? :
lyudmila [28]
Ok sistah, me got you, 
(1) gather together, or increasing number
(2) price or amount charged
(3) intentionally 
(4) Take or seize
(5) extremely large or great
(6) savagely fierce or violent 
(7)<span>irritate intensely
(8) miffed
(9)</span><span>well meaning and kindly
(10) pensive

Hope i helped :)</span>
8 0
3 years ago
Other questions:
  • Gina's teacher has sent her a Word document that contains the names of all the students who are participating in the
    11·2 answers
  • Vaporization is the process in which liquid is sufficiently cooled to change states of matter from a liquid to a vapor true or f
    8·1 answer
  • How does the mantle interact with the tectonic plates at a convergent boundary?
    14·2 answers
  • A _____ is a unique name that identifies an Internet site. URL Browser AOL IA
    13·1 answer
  • What does it mean to compact and repair your database? What is the difference between a single
    15·1 answer
  • Pride Group of Companies is making tremendous profits in different categories of electronic goods. The group of managers have to
    12·1 answer
  • How can injection attacks be prevented? Check all that apply
    6·2 answers
  • How do you enter the decimal 73 into the computer?
    11·1 answer
  • The current annual interest rate is 5 percent, and you are taking out a 20-year loan with a monthly end-of-month payment. If you
    5·1 answer
  • What is the "Driver's Compact Law"?
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!