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
amid [387]
3 years ago
9

ppose we have a Rectangle class that includes length and width attributes, of type int, both set by the constructor. Define an e

quals method for this class so that two rectangle objects are considered equal ifThey have the exact same length and width.They have the same dimensions—that is, they are congruent.They have the same shape—that is, they are similar.They have the same perimeter.They have the same area.
Computers and Technology
1 answer:
vichka [17]3 years ago
8 0

Answer:

Check the explanation

Explanation:

#include <bits/stdc++.h>

using namespace std;

class Rectangle{

  public:

      int length;

      int breadth;

      Rectangle(int l,int b){

          length = l;

          breadth = b;

      }

      int area(){

          return length*breadth;

      }

      int perimeter(){

          return 2*(length+breadth);

      }

      bool equals(Rectangle* r){

          // They have the exact same length and width.

          if (r->length == length && r->breadth == breadth)

              return true;

          // They have the same area

          if (r->area() == area())

              return true;

          // They have the same perimeter

          if (r->perimeter() == perimeter())

              return true;

          // They have the same shape-that is, they are similar.

          if (r->length/length == r->breadth/breadth)

              return true;

          return false;

      }

};

int main(){

  Rectangle *r_1 = new Rectangle(6,3);

  Rectangle *r_2 = new Rectangle(3,6);

  cout << r_1->equals(r_2) << endl;

  return 0;

}

You might be interested in
Help please fast!
serious [3.7K]

Answer:

the answer is: B: personal learning networks allow you to digitally collaborate with peers.

Explanation:

8 0
3 years ago
Psychologists studying infant memory want to determine at what age babies can remember specific events. An experimenter uses sev
vodka [1.7K]

Answer:

the number of imitated actions

Explanation:

According to my research on different research terminology, I can say that based on the information provided within the question the dependent variable in this situation is the number of imitated actions. This is because the the age in which babies remember specific events depends completely on the amount of actions imitated by the children.

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

5 0
4 years ago
How do you delete your brainly account
Artyom0805 [142]

Answer:

moderators only can banned you and delete all

5 0
2 years ago
Write a program called interleave that accepts two ArrayLists of integers list1 and list2 as parameters and inserts the elements
nata0808 [166]

Answer:

Explanation code is given below along with step by step comments!

Explanation:

// first we create a function which accepts two ArrayList of integers named list1 and list2

public static void interleave(ArrayList<Integer> list1, ArrayList<Integer> list2)

{

// we compare the size of list1 and list2 to get the minimum of two and store it in variable n

   int n = Math.min(list1.size(), list2.size());

   int i;

// here we are getting the elements from list2 n times then we add those elements in the list1 alternating (2*i+1)

   for (i = 0; i < n; i++)

     {

       int x = list2.get(i);

       list1.add(2 * i + 1, x);

      }

// if the size of list1 and list2 is same then program stops here else we need to append extra elements at the end of list1

// then we check if the size of list2 is greater than list1 then simply add the remaining elements into list1

   if (i < list2.size())

{

       for (int j = i; j < list2.size(); j++)

           {

                list1.add(list2.get(j));

            }  

     }  

}

Sample Output:

list1=[1, 2, 3]

list2=[5, 6, 7, 8, 9]

list1=[1, 5, 2, 6, 3, 7, 8, 9]

7 0
4 years ago
The pressurization system includes _____ identical and redundant cabin pressure controllers (CPC) which regulate the opening of
Soloha48 [4]

Answer:

2

Explanation:

The pressurization system is a system within every human flown aircraft that stabilizes the pressure within the aircraft in order to provide a comfortable and safe environment for passengers. According to my research on this pressurization system , I can say that based on the information provided within the question this type of system includes 2 identical and redundant cabin pressure controllers.

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

6 0
3 years ago
Other questions:
  • You can access decorative underlines and change their color through the ____ drop-down.
    8·1 answer
  • Which best describe a resource each student could use to find information
    6·2 answers
  • In this website/app what are the points for?
    7·1 answer
  • The registrar does all of the following except:
    12·2 answers
  • If you want to learn more about a command, point to its button and wait for the ____ to appear.
    13·1 answer
  • What is an internal node?
    11·1 answer
  • When a cells number format is “time” it will show a value in what format
    5·1 answer
  • How do I insert a row above the selected row in between row and row 2 revenue xls
    5·1 answer
  • Project manager Kevin has to create a project team organizational chart. Which activity should he perform before creating this c
    9·1 answer
  • Website designers work on the code and programming of a website, not the style or layout of the site.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!