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 operating system introduced new features such as virtual memory and
EleoNora [17]

it was a Macintosh which was released by Apple may 13th 1991.

6 0
3 years ago
Why is Linux widespread in academic environments?
boyakko [2]
The answer will be... hmmm.. D?
8 0
3 years ago
By the definition of a computer, justify if a mobile phone and a calculator are computers or not​
likoan [24]

Answer:

It depends on the features of the Calculator but most mobile phones are computers.

Explanation:

A computer is an electronic device that can accept data (Both can), process the data (both can), produce the results of the processed data (both can) and store both result and initial data (some calculators can, some cannot but most mobile phones can).

In my opinion, they are computers but that's dependent on their features especially storage.

3 0
3 years ago
Among the rights you have as a user of computing resources is the right to​ _______.
Ivanshal [37]
Protection from​ viruses, worms, and other threats
3 0
4 years ago
Read 2 more answers
Suppose that you want to write a program that inputs customer data including name, zipCode, balance, and regionNum. At the end o
Misha Larkins [42]

Answer:

The answer to the given question is option "b".

Explanation:

In this question, we use option b because this option will provide a list of the number of customers in 12 each region owing more than $1,000.  and other option is not correct that will be described as:

  • In the option a, It will provide the balance of the customer.
  • In the option c, It will decrease the list of region number.  
  • In the option d, It will provide the total balance of the regions.  

That's why the answer to this question is option b which is "customerCount[regionNum] = customerCount[regionNum] +1".

3 0
3 years ago
Other questions:
  • Which of the case studies that you read (Walmart, Target or 5 Big Data Industries) caught your attention and why? Before reading
    11·1 answer
  • What is another way to use the Help feature in Access 2016?
    15·2 answers
  • What makes it possible for e-mail to be sent and received on a wide variety of devices, including cell phones, PDAs, laptops, an
    12·1 answer
  • Rapid development programming languages eliminate the possibility of having bugs in code. True or False
    8·1 answer
  • What is the maximum rate at which computers A and B can communicate, via router X? (your answer should be in Mbps)
    12·1 answer
  • What occurs when an application sends user-fed data directly to a web browser without authenticating or deleting the content? Cr
    15·1 answer
  • How would I add a play again function to this code in python?
    9·1 answer
  • What is the role of a design tWhat is the role of a design tool in a Robotic Process Automation (RPA) solution?
    9·1 answer
  • You are a solutions engineer working for a large communications company that is migrating its existing server estate to AWS. You
    12·1 answer
  • HELP ASAP IF YOU KNOW PYTHON 2!!!
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!