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
Choose the word that best completes this sentence. Caught-in and caught-between injuries result from a person being squeezed, ca
loris [4]
I do not know, i really hope you dont fail!!!!!!!!!
8 0
3 years ago
Read 2 more answers
For each of the following scenarios, write down what feature should be used in
inessss [21]

Answer:

d

Explanation:

5 0
3 years ago
The process of acquiring data for a program to use is called:
marusya05 [52]

Answer:

a. Data Entry

Explanation:

Great Question, it is always good to ask away and get rid of any doubts you may be having.

The process described in the question is called Data Entry and/or Data Acquisition. Data is gathered and stored in the computers memory to then be used by a specific program or function. Without this data being gathered the program or function cannot complete its task. Therefore Data Entry is extremely needed for the correct and healthy function of a program.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

8 0
3 years ago
What is the typical relationship between time and interest rate?
prisoha [69]
The relationship between time and interest is: time allowed to repay the loan (monthly payments)
7 0
3 years ago
X is a natural number with<br>GCF(x, 36) = 9 and LCM(x, 36)<br>36) =108<br> Find x.​
Ksenya-84 [330]

Answer:

27

Explanation:

GCF(27, 36) = 9

LCM(27, 36) = 108

6 0
3 years ago
Other questions:
  • What are three things to consider in programming design?
    14·1 answer
  • What are some ways in which reading and writing have changed in our newly networked world
    10·1 answer
  • Which ONE of these usability goals is more important when designing software that someone would use only once or twice, such as
    13·1 answer
  • Beverly is creating a website for her new clothing company. Aside from including photographs, how can she use the index page to
    8·2 answers
  • How do assembly language different from machine language?
    15·1 answer
  • Please answer please
    12·2 answers
  • Use the drop-down menus to complete the steps for rearranging the layout of a form.
    15·1 answer
  • A method signature for a method consists of all elements of the method except the body. That is, a method signature consists of
    14·1 answer
  • Write a program that gets a list of integers from a user. First, the user should be asked to enter the number of integers to be
    5·1 answer
  • What does the asterisk (*) after select tell the database to do in this query?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!