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
alex41 [277]
3 years ago
12

For this exercise, you'll use the Rectangle class below (you can assume that the length and width are measured in feet).

Computers and Technology
1 answer:
dusya [7]3 years ago
8 0

Answer:

The solution code is written in Python:

  1. class Carpet:
  2.    def __init__(self, rect, cost):
  3.        self.size = rect  
  4.        self.costPerSqFoot = cost  
  5.    
  6.    def cost(self):
  7.        carpetCost = self.size.area() * self.costPerSqFoot  
  8.        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).

You might be interested in
You designed a program to create a username using the first three letters from the first name and the first four letters of the
Pavel [41]

Answer:

See Explanation

Explanation:

The question would be best answered if there are options to select from; since none is provided, I will provide a general explanation.

From the question, we understand that, you are to test for Jo Wen.

Testing your program with this name will crash the program, because Jo has 2 letters (3 letters are required), and Wen has 3 letters (4 letters are required)

So, the step that needs to be revisited is when the username is generated.

Since the person's name cannot be changed and such person will not be prevented from registering on the platform, you need to create a dynamic process that handles names whose lengths are not up to the required length.

7 0
3 years ago
Which of the following is NOT an algorithm?
Nina [5.8K]
I’m pretty sure it would be “A novel assigned in English class” (algorithm is a process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer.) Example: the recipe for baking a cake.
3 0
3 years ago
What is an embedded system. Give examples
IRINA_888 [86]

Answer:

An embedded system is a part of a larger system which has either one or a limited number of dedicated functions.

It doesn't require much power to run and is cheap to make and design.

Explanation:

Examples include: cars, microwaves, traffic lights, washing machines, phones etc

6 0
3 years ago
list three quantitative characteristic properties of water explain why they are considered characteristic
tia_tia [17]

Answer:

The three quantitative characteristic properties of water is explained below in detail.

Explanation:

The three quantitative components of water incorporate the following:

1.Freezing point:

The water has a freezing point of 0 degrees Celsius.

2. Boiling point:

The water has a boiling point of 100 degrees Celsius.

3. Melting point:

The melting point of ice is 0 degrees Celsius.

These properties are all uncommon to water. Being uncommon means that these characteristics are only noticeable in water; hence, they can be beneficial in recognizing such a substance.

5 0
3 years ago
____ is designed for short-distance connections and has only a few lambdas, with a greater space between lambdas. Group of answe
givi [52]

Answer:

The answer is Coarse wavelength division multiplexing (CWDM)

Explanation:

CWDM is the wavelength designed for short- distance connections  and has only a few lambdas. It is mostly used nowadays as a type of wavelength technologies deployed in cities and inner access ways. It is inexpensive and thus a cost effective wavelength  division multiplexing. Cost effective lasers can be used in CWDM due to the spacing of about 20nm between its wavelengths.

4 0
3 years ago
Read 2 more answers
Other questions:
  • The analog signals that carry analog or digital data comprise composites built from combinations of simple sine waves.
    12·1 answer
  • In which type of attack do you get malicious code in links from seemingly reliable websites?
    14·1 answer
  • A(n) ____ instruction might look like a meaningless string of 0s and 1s, but it actually represents specific operations and stor
    9·1 answer
  • ________ programming is a method of writing software that centers on the actions that take place in a program.
    8·1 answer
  • When planning a backup strategy, ideally one needs to prioritize important data and only back up what is absolutely necessary fo
    15·1 answer
  • What are the raw materials for the process of photosynthesis​
    6·2 answers
  • Why the internet is not considered a mass medium in Africa​
    13·2 answers
  • Who is the fan of Techno gamerz and Total gaming
    10·1 answer
  • I re-made the human version of Daddy Dearest from Friday Night Funkin
    14·2 answers
  • The difference between page break and section brek​
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!