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
Text that does not fit in a cell
Aneli [31]
To make all wrapped text visibly, do the following to manually adjust the row height:<span>Select the cell or range for which you want to adjust the row height.On the Home tab, in the Cells group, click Format.<span>Under Cell Size , do one of the following: To automatically adjust the row height, click AutoFit Row Height.</span></span>
3 0
3 years ago
Choose the false statement below. The content that displays in the browser is contained in the head section. The content that di
aivan3 [116]

Answer:

The content that displays in the browser is contained in the head section.

Explanation:

The content that displays in the browser is contained in the head section, this is the false statement because the The HTML head is the contents of the <head> element.

The head's content is not displayed on the page. Instead, the head's job is to contain metadata about the document.

3 0
3 years ago
Consider the following code: def tryIt(b): for i in range(len(b)): b[i] = b[i] + 100 #***********MAIN************ x = [] x = [56
WINSTONCH [101]

Answer: I took a high school robotics class when I was in 5th grade and I don't even understand your code there aren't any instructions other than <em>"</em><em><u>Consider</u></em><u>"</u> the following code you may want to improve your question

7 0
2 years ago
6.Decreasing a telescope's eyepiece focal length will:
Ghella [55]
B is the correct answer to ur questions
8 0
3 years ago
What do you think of my profile picture
Gnom [1K]

ayo it's pretty sweet lma.o.

8 0
3 years ago
Read 2 more answers
Other questions:
  • Say our confusion matrix is as follows, calculate precision, recall, and accuracy. Interpret the results for the positive class.
    10·1 answer
  • Functions that are built-in into PHP to perform some standard operations.
    15·1 answer
  • When adding cells you must use a "+" symbol, you cannot use a ":" symbol.<br><br> ☐ True<br> ☐ False
    13·1 answer
  • You are system administrator with hundreds of host workstations to manage and maintain. You need to enable hosts on your network
    14·1 answer
  • In linear​ programming, what are restrictions that limit the degree to which a manager can pursue an​ objective?
    15·1 answer
  • According to which virtue do you need to secure information by limiting computer access to authorized personnel only?
    6·1 answer
  • Write a calculator program using a switch statement that: a) Prompts the user to enter two numbers b) Prompts the user to select
    6·1 answer
  • Solve(-8/3)+7/5 please answer​
    5·1 answer
  • I can't solve this <br> Python loop with while statement
    15·2 answers
  • Provide the user with a menu for the following 10 algorithms. Then ask which algorithm the user decides she/he wants to use. Fin
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!