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
What is the full form of ARPANet, WAN,FTP,DCP,HTML,ISP and last WWW​
Lapatulllka [165]

Advanced Research Projects Agency Network,

wide area network

File Transfer Protocol

?

Hypertext Markup Language

Internet service provider

world wide web

6 0
3 years ago
Read 2 more answers
Do debit cards allow you to draw funds directly from your checking accounts
LekaFEV [45]
Some of them do let you draw funds but not all debit cards
4 0
3 years ago
A friend asks you for help writing a computer program to calculate the square yards of carpet needed for a dorm room. The statem
quester [9]

Answer:

A friend asks you for help writing a computer program to calculate the square yards of carpet needed for a dorm room. The statement "the living room floor is rectangular" is an example of a(n) <u>assumption</u> . The length and width of the room are examples of <u>known</u> information, which you can obtain as <u>input</u> from the user.

Explanation:

The given question is a Problem statement.

Problem statement can be defined as the brief description of an issue that needs to be focused in order to reach the require goal.

So the parts that a problem statement may have include:

  • facts and figures (assumptions), that are known in the given scenario.
  • data required (solution)to be calculated by focusing on present assumptions (given as input by the user).

So the attributes to be filled into blanks of given statement are assumption, known, input.

i hope it will help you!

4 0
4 years ago
Write a program that inputs two characters first and second, and then prints all non-alphabetic characters starting from second
baherus [9]

Answer:

fbtcft gdfgfffff tvfft gxf

8 0
3 years ago
Select the correct answer.
Triss [41]

Answer:

b or d

Explanation:

3 0
3 years ago
Other questions:
  • How to Ctrl + shift + F4 but in a HP laptop?​
    8·2 answers
  • When you right-click certain areas of the Word or other Office app windows, a command menu will appear. Group of answer choices
    13·1 answer
  • What are some ways in which reading and writing have changed in our newly networked world
    10·1 answer
  • Why are high-quality transformers wound with large diameter wire?
    8·1 answer
  • Jamie posted all the journal entries into ledgers. After the postings, Jamie realizes that the debit side of the travel account
    10·1 answer
  • What is the output <br>this is a computer science question ​
    8·1 answer
  • 6. According to camp policy, staff members need to be at least 23 years old to transport students. Dean now wants to determine h
    9·1 answer
  • Dispositivo de computo
    5·1 answer
  • Keli is unable to find a shape that meets her needs. Which feature in Power Point should she use to create shapes that are compl
    6·1 answer
  • Which of the following occupations uses math concepts to determine if a particular event would occur and the related costs of th
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!