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
Which programming model is distinct from the others discussed because it focuses on the data, or object, rather than the logic,
DIA [1.3K]
The programming model that is distinct from the others discussed because it focuses on the data, or object, rather than the logic, or function is object-oriented programming.
4 0
3 years ago
.xls is the file extension for this file type
anygoal [31]

Answer:

Spreadsheet File

Explanation:

Most word processing files are doc or docx

Most internet files are htm or html

Most Image files are jpg or png

6 0
3 years ago
Why would you activate more than one nic on a pc?
natima [27]
For redundancy in case of failure or for connecting them to different subnets. 
4 0
3 years ago
To delete rows from the database, use the ____ command
Yakvenalex [24]
DELETE FROM command.

Example:
DELETE FROM table_name WHERE id = 5
3 0
3 years ago
Who primarily determines the value of a technology over time?
Novosadov [1.4K]

Answer:

a

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • The c++ operator _______________ is used to destroy dynamic variables.
    5·1 answer
  • Write the interface (.h file) of a class Counter containing: A data member counter of type int. A data member named counterID of
    13·1 answer
  • What inspired john logie baird to create the television?
    11·1 answer
  • At what x position are the ellipses drawn??? thanks ♡​
    6·1 answer
  • bro this scared me, i thought i just got hacked, could someone explain why when i went to ask a question, it kicked me out my ac
    9·2 answers
  • The force required to slide an object is equal to _____.
    13·1 answer
  • Searching for a particular record in a database is called “querying the data.”<br> True<br> False
    9·2 answers
  • Site at least 3 articles of impact of internet that affect in our daily lives.
    15·1 answer
  • Which of the following statements best reflects the pros and cons of overtime potential for a line installer or repairer?
    15·1 answer
  • 1. Keisha is in her first semester of college and is taking 10 credit hours: ACA 122, CIS 110, PSY 150, and developmental math.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!