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
Remember not to use tools that are ________ in any way.
kupik [55]
Remember not to use tools that are rusty and damaged in any way.
3 0
3 years ago
In a presentation, bullets in a text box will do which of the following?
lbvjy [14]
I'm almost certain that it is A. "Help you present your data with concise statements". Hope this helped :) Xx
8 0
3 years ago
¿Who is the target user of the bird quiz?
ella [17]

Answer:

sorry

Explanation:

8 0
3 years ago
You found an image on the Creative Commons that you would like to use. How do you give credit to the author? *
Archy [21]
You need to write the author’s name
7 0
3 years ago
Read 2 more answers
List 8 things that online friends say and list 8 things that online fakes say.
morpeh [17]

Answer:

online friend

hi

hello

hahaha

how are you

how your day

i dont known

where are you

what are you doing

online fakes

are you serious

are you crazy

what do you want

firts of all

lets talk about later

6 0
3 years ago
Read 2 more answers
Other questions:
  • What is a Network-layer routing technology that enables a group of workstations to share a single registered address?
    5·1 answer
  • ZO
    14·1 answer
  • Codio Challenge Question (Python)
    6·1 answer
  • Which of the following STEM discoverers developed a new type of computer hardware?
    11·1 answer
  • Kelvin owns a small trading firm. Recently, he suspected that some of his employees were using fraudulent activities for their p
    5·2 answers
  • Select the correct answer.
    10·2 answers
  • 1) APPLICATION BASED QUESTION:-
    5·1 answer
  • (I WILL GIVE BRAINLIEST) Which steps will delete an appointment?
    8·1 answer
  • Antivirus is a program that detects error.True or False.​
    9·1 answer
  • given the variables temperature and humidity, write an expression that evaluates to true if and only if the temperature is great
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!