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
A customer states that when she removes the printed pages from her laser printer output tray, the black ink smears all over her
luda_lava [24]

Answer:

B. Fuser unit

Explanation:

Based on the scenario that is being described it can be said that the most likely problem is the Fuser unit. This is a part that plays an important role in the printing process. This unit melts the toner and compresses it in order to leave the impression on the paper with heat. A faulty fuser unit will not compress correctly and leave wet ink on the paper causing it to smear.

7 0
3 years ago
In this class, it is very common for your computer screen to look like this. What is this?​
Vsevolod [243]
Theres no Picture???
8 0
2 years ago
Which type of storage disk and disk drive can you use in the given situation?
AfilCa [17]

I : DVD

II:DVD-R

A DVD-RW would work too.

3 0
2 years ago
Write at least and explain four types of escape sequences and create an example in an IDE which consist of the mentioned escape
slamgirl [31]

Answer:

- \' is used to escape a single quote in a string enclosed in single quotes like;

my_string = 'this is John\'s ball'.

- \n is used to jump to a new line, Eg;

my_string = "Johns is a good boy\nbut he hates going to school."

the next set of the string after the '\n' character is displayed on the next line.

- \t is used to add a tab space to a string.

my_string = 'Jane is \thungry'

the character adds four character spaces before the word 'hungry'.

- \r adds a carriage return (or enter in keyboards) to start a new block paragraph in a string.

my_string = "Johns is a good boy\rbut he hates going to school."

Explanation:

Escape sequences in programming are used to format strings or output syntax of a program. They always begin with the backslash. Examples of escape sequence are " \' ", "\n", "\t", "\r", etc.

5 0
3 years ago
You want to make it possible for your smartphone to share its internet access wirelessly with your friends device which of the f
IrinaVladis [17]

Answer:WiFi or hotspots

Explanation:you will have to turn on your WiFi or hotspots on your smart phone and allow your friend to also turn his WiFi or hotspot after you will search for your WiFi and connect there he can use the internet

6 0
3 years ago
Other questions:
  • What type of survey can help a network administrator make decisions about bands, channels, and widths when installing new access
    9·1 answer
  • Can someone pls explain this question??
    7·1 answer
  • A user can easily moved to the end of document by pressing what key combination?
    8·2 answers
  • When you are printing handouts, which of these can you do? A. Save paper by placing more than one slide per page. B. Check the f
    7·1 answer
  • IF ACCURATE = BRAINLY (if u answer rubbish randomness= reported AND if you got questions dont ask in answer slot= reported)
    13·1 answer
  • Beyond adding equations, what else does the Insert Equation feature allow users to do?
    7·1 answer
  • If a student passes off an author’s work as his or her own, the student has
    6·1 answer
  • Differentiate between patent and copyright.
    6·2 answers
  • What type of databases is not limited by the data’s physical location?
    7·1 answer
  • Dynamics
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!