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
Contact [7]
3 years ago
8

class bClass{public:void setX(int a);//Postcondition: x = a;void print() const;private:int x;};class dClass: public bClass{publi

c:void setXY(int a, int b);//Postcondition: x = a; y = b;void print() const;private:int y;};Which of the following correctly sets the values of x and y?a. void dClass::setXY(int a, int b){x = bClass.setX(a);b = y;}b. void dClass::setXY(int a, int b){x = bClass::setX(a);y = bClass::setY(b);}c. void dClass::setXY(int a, int b){x = a;y = b;}d. void dClass::setXY(int a, int b){bClass::setX(a);y = b;}
Computers and Technology
1 answer:
MaRussiya [10]3 years ago
6 0

Answer:

The answer to the given question in the option "a".

Explanation:

In the given c++ program the correct sets value of x and y is option a:

void dClass::setXY(int a, int b) //function implementation

{ //function body.

x = bClass.setX(a); //variable x hold value of setX() function.

b = y;  //variable b holds value of y.  

}

And other option are not correct that can be described as:

  • In option b, x is private variable of the base class that is inherit by the derived class but variable y is not part of the base class. that's why it is wrong.
  • In option c, x= a is correct but y=b is not correct. that's why it is wrong.
  • In option d we access the value of the private variable x that is a part of the base class but in this we not use any variable that holds its value. that's why it is wrong.

So the answer to this question is the option "a".  

You might be interested in
Why is the len ( ) function useful when using a loop to iterate through a stack?
Marizza181 [45]

The len ( ) function will run with each iteration, printing the element number each time.

6 0
3 years ago
What is the function of the NOS? Select all that apply.
Zigmanuir [339]

Answer:

.network management

Explanation:

pls need brainliest

3 0
3 years ago
Read 2 more answers
What is one advantage and disadvantage of designing a support security that might be based on a centralized model, where all sen
defon

Co-Ordination Difficulty: ...
Waste of Resources: ...
Larger Interests of the Enterprise Neglected: ...
Emergency Decision not Possible: ...
Lack of Qualified Managers: ...
Certain Activities Decentralization not Possible:
8 0
3 years ago
ASAP PLS HELP: I’ll give brainliest if you u answer them all correctly!!
ra1l [238]

Answer:

1 c

2 a

3 c

4 b

5 c

6 b

7 d

8 a

9 d

10 b

6 0
3 years ago
Read 2 more answers
What is the difference between HTML and CSS? * 1. CSS is a markup language unlike HTML. 2. HTML is a backend technology and CSS
GarryVolchara [31]
The anserw is the third one. 
5 0
3 years ago
Read 2 more answers
Other questions:
  • Company A is setting up a network of mostly Windows machines. Which networking file system protocol would you recommend for maxi
    5·1 answer
  • 11. The golden rule of safe driving is: A. Always drive at the posted speed limit B. Never drive while physically or mentally im
    6·1 answer
  • Many computer magazines and Web sites present comparisons of several DBMSs. Find one such DBMS comparison article and compare th
    10·1 answer
  • How do optical discs store data? select one:
    15·1 answer
  • In 2d design, form makes what possible?
    15·1 answer
  • What is the web of trust
    7·2 answers
  • ______ are used to store all the data in a database.
    7·1 answer
  • Write two examples of hard copy output?​
    9·1 answer
  • Choose and explain, step by step, one method of backing up student files either manually or using a cloud service.
    10·1 answer
  • Iciples UI
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!