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 relational database is different from a simple database because it has more than one _____. record ID number table field
Ulleksa [173]

Answer:Table

Explanation:A relational database has structures and thus have more than one table. The tables consist of row (for entry) and column (for data). As a result, data are organized in a simple manner and are normally consistent.

6 0
3 years ago
Critics are concerned about how easy it is to upload and download music on the Internet because:
evablogger [386]
C. people have to buy entire albums, which can get expensive.
6 0
3 years ago
Read 2 more answers
What is token passing?
Flauer [41]

Answer:

Answer is A network access method that avoids the possibility of data collisions.

Token Ring is the precursor to Ethernet and CSMA/CD to avoid packet collisions.

Explanation:

8 0
4 years ago
What command is used to locate all occurrences of the word "dog" in a document?
rosijanka [135]

Microsoft Word can easily find text in your document. This search is handled by the Find command. To locate the occurrences of the word dog in a word document, you can either click the find button on the home tab or press the combination keys ctrl+F and type the word dog. You also press ctrl+G. The Find and Replace dial box will pop up, with the Go To tab displayed. You will go ahead and click the Find tab and type the word dog.

3 0
3 years ago
Read 2 more answers
A user mounts a device to a mount point directory and realizes afterward there are files previously found within the mount point
UkoKoshka [18]

Answer:

The answer to this question is "Unmount the device from the directory".

Explanation:

A mount is a process where a device is preparing to connect and the unmount process stands for disconnecting the device. When a user mounts a device to mount point directory that is normally known as an available directory where an external file is placed, but the user found that the file is already available in the device so, the user has only one option that  "unmount the device from the directory".  

6 0
3 years ago
Other questions:
  • You have heard that the Linux distribution your are going to install to run a new application runs best on a RISC architecture.
    15·1 answer
  • 2. Billys teacher asked him to type a report about asian food. Which paragraph format should he use?
    12·2 answers
  • What’s good and bad about having social media?
    14·2 answers
  • Which type of software has no restrictions from the copyright holder regarding modifications of the softwares internal instructi
    12·1 answer
  • The _____ is an information and communication-based electronic exchange environment mostly occupied by sophisticated computer an
    14·1 answer
  • What is an identified component of a software program that might allow a hacker or other intruder to gain entry and control of a
    10·2 answers
  • The objective of this task is to use Scapy to estimate the distance, in terms of number of routers, between your VM and a select
    10·1 answer
  • What are movies filmed before 1990's?
    14·1 answer
  • It converts Assembly Language into machine language?​
    15·1 answer
  • Where to get industrial circuits far cry 6
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!