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
Consider sending a stream of packets from host a to host b using ipsec. typically, a new sa will be established for each packet
nordsb [41]

Consider sending a stream of packets from Host A to Host B using Ipsec. Typically, a new SA will be established for each packet sent in the stream. True or False? Tweet Answer FALSE. REASON: Ipsec SA is first connect with Host A and Host B. So, all packets in the stream use the new SA.

8 0
2 years ago
Whats the relationship between the CPU and motherboard
Mashcka [7]

Answer:

Both perform processes vital to running the computer's operating system and programs -- the motherboard serves as a base connecting all of the computer's components, while the CPU performs the actual data processing and computing.

Explanation:

6 0
4 years ago
Based on this information, what is their gross income for six months? Roderick
alexira [117]
Multiply what he makes a month by six
8 0
3 years ago
Assume that word is a variable of type String that has been assigned a value. Write an expression whose value is a String consis
DerKrebs [107]

Answer:

Follwing is the python code:-

word=str(input("Enter the string\n"))

new=word[0:3] #expression for first three characters of the string.

print(new)

Output:-

Enter the string

chandelier

cha

Explanation:

The expression word[0:3] is for extracting first three characters form the string.

word[0:3] = It extracts characters from index 0 to index 2 it does not include 3.3 is excluded.

7 0
3 years ago
What are some of the challenges that could arise from setting up a file management system on a computer?
emmainna [20.7K]
File management is set of methods for naming, storing and handling files. <span>A few key things that should be taken into consideration are: date, genre, occasion, and subject. After setting up a file management system on a computer the following challenges could arise: </span>standardize file naming, folder structure, metadata use and more. .
5 0
3 years ago
Other questions:
  • Write a program that calculates an adult's fat-burning heart rate, which is 70% of 220 minus the person's age. Complete fat_burn
    10·1 answer
  • When doing a complex presentation, which of the following would be the best tool to begin designing your presentation?
    11·2 answers
  • Think of a game you are familiar with and identify at least three team responsibilities which were required to make the game, on
    5·1 answer
  • Which of the Arts, A/V Technology, and Communication career cluster pathways are involved with producing a product for an audien
    8·2 answers
  • A(n ____ with a drop down menu provides consistency in function and appearance making it easy for users to learn and work with t
    7·1 answer
  • Which term describes the situation wherein a jury fails to reach a unanimous verdict? A occurs when a jury cannot reach a unanim
    14·1 answer
  • I had tried to turn on Linux on the Chromebook but it's not working
    11·2 answers
  • A student registers for a course in a university. Courses may have limited enrollment i.e a student must
    5·1 answer
  • Who invented computer ?​
    9·2 answers
  • Cybersquatters:_________.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!