Answer:
The solution code is written in Python:
- class Carpet:
- def __init__(self, rect, cost):
- self.size = rect
- self.costPerSqFoot = cost
-
- def cost(self):
- carpetCost = self.size.area() * self.costPerSqFoot
- return carpetCost
Explanation:
Presume that there is existence of Rectangle class as given in the question, Carpet class is written. The Carpet constructor is defined that take Rectangle object,<em> rect</em>, and <em>cost</em> as parameter (Line 2). To create data member of Carpet class, keyword "self" is used to precede with the name of the data members, <em>size </em>and <em>costPerSqFoot </em>(Line 3-4).<em> </em>The data members are initialized with the parameter <em>rect </em>and <em>cost</em>, respectively.
Next, cost method is defined (Line6 - 8). Within the <em>cost </em>method, the area method of Rectangle object is invoked by expression, <em>self.size.area() </em>and<em> </em>this will return the area value and multiplied with the costPerSqFoot to get the carpet cost and return it as output (Line 8).
Answer:
"@page" is the correct answer for the above question.
Explanation:
- "@page" is a syntax of CSS which will affect that page which is converted from the hard copy from the soft copy. It means it affects the page which will render the output.
- So If the Thelma wants to set the margins on the output page then he can do this by the help of the "@page" tag which is defined in the CSS, and then the margin is set to this tag by the help of margin statement.
Answer:
"message encoding, message size and message delivery" are the correct answer for the above question.
Explanation:
The above defined are the three requirements which are defined as the protocol used in communication. These three requirements are a very essential part of communication because-
- Message Encoding is the first requirement, which is used to encode the message so that the hacker can not hack the communication data from the network.
- The second requirement is Message size which fixed the size and the number of packets used to send for the communication.
- The third requirements are Message delivery, for which the protocol needs to define the mechanism to overcome the loss of the data.