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
When you hear the word “stress” what does it mean to you? How does stress affect you and what do you do to cope with stress
stepan [7]

   Ways to Cope with  Stress

  • Re-balance Work and Home.
  • Build in Regular Exercise.
  • Eat Well and drink lots of water.
  • Connect with Supportive People.
  • Carve out Hobby Time.
  • Practice Meditation, Stress Reduction or Yoga.
  • Sleep Enough.
  • Bond with Your Pet.

 

hope it helps! :)

3 0
2 years ago
Good day Statistical Methods tutor , I would like to know the formula for calculating the percentage of stockouts for the given
sveticcg [70]

In order to derive the probability of stock outs, divide the total value of the stock outs by the number of requests demanded. The resulting figure must then be multiplied by 100.

<h3>What is a stock out?</h3>

In business, a stock out refers to a condition where in a certain item or items are no longer available in stock.

The formula can be sated simply as:

Probability of Stock outs = (No of stock outs/ number of demand requests) x 100

Thus Number of Stock outs = Total probability of stock outs * total number of demand requests.

<h3>What is the formula for the Total Cost?</h3>

The formula for Total Cost is given as:

Total Fixed Cost + Total Variable Cost;

TC = TFC + TVC

Learn more about stock outs at:
brainly.com/question/16209393
#SPJ1

5 0
2 years ago
Which item best describes fiber optic transmission?
sveticcg [70]

Answer:

a

Explanation:

analog signal sent through tiny glass strands

6 0
3 years ago
When light does not pass through or bounce off an object, it is said to be
Dmitry [639]
The object is said to be absorbed
3 0
2 years ago
Read 2 more answers
Which of the following is a sign that a website is inappropriate?
nata0808 [166]

Answer:

A

Explanation:

If you find something embarrassing, its more likely that other people with also think its embarrassing. All the other points are on the internet right now. Amazon sells things, News show information and there are political campaigns to show you there offers

3 0
3 years ago
Read 2 more answers
Other questions:
  • The following declaration appears in a program: short totalPay, basePay = 500, bonus = 1000; The following statement appears in
    9·1 answer
  • The collodion process was significantly more expensive than the cost of a daguerreotype
    10·1 answer
  • Viet drives around and checks meters to document the amount of electricity used in homes. What Energy pathway is he a part of? E
    9·2 answers
  • If r is an instance of the above Person class and oddNum has been declared as a variable of type boolean, which of the following
    8·1 answer
  • What is the definition of digital literacy?
    7·2 answers
  • Abby has always dreamed of having her own ice cream shop. Now as a young entrepreneur she has decided to pursue her dream, but s
    13·1 answer
  • What best describes the ability to increase the access to server resources and provide fail-safe services by linking two or more
    13·1 answer
  • Which type of information should never be given out on social media?
    5·2 answers
  • You are a software engineer at a company where management routinely encourages you and your colleagues to use pirated software.
    5·1 answer
  • 25 points
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!