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
A(n) is the tool that will help you the most when developing the content you will use in your presentation.
ikadub [295]

Answer:

Outline

Hope it helps :)

Explanation:

7 0
3 years ago
Which method do software testers use to isolate new code from the rest of the network during the test stage of the software deve
disa [49]

Answer:

Sandboxing.

Explanation:

SDLC or software development life cycle is a systematic approach to software development. It marks the birth and death of an application.

The application development starts from the research of the properties of the application to the design and development or implementation of the application.

After the implementation of the software, it is tested, comparing the design and the codes in the development process. The sandboxing testing process helps to isolate and test new lines of code added during the testing phase.

3 0
3 years ago
What is the advantage of using CSS?
zhannawk [14.2K]
Your answer would be B.) "It streamlines the HTML document."
8 0
3 years ago
Read 2 more answers
Which type of formatting would you apply to spreadsheet data so that each cell is outlined?
rjkz [21]

Answer:

D. Border

Explanation:

Edge 2020

5 0
2 years ago
Which document lists the planned dates for performing tasks and meeting goals identified in the project plan?
Mnenie [13.5K]
<span>The document is called as Project schedule. this document contains the tasks that needs to be performed, the time that is given to the perform the task, the target dates. It also contains the budget of the project and the budget can be represented task wise. This helps in performing the project in a more organized way.</span>
5 0
3 years ago
Other questions:
  • when reading a recipe ingredients witch substance make the rice an unhealthy choice if it is present in a high amount
    13·1 answer
  • For all those among our fans and SpongeBob fans which is better SpongeBob or amount us
    11·2 answers
  • Your boss bought a new printer with a USB 3.0 port, and it came with a USB 3.0 cable. Your boss asks you:
    7·2 answers
  • What is the first thing you should do when troubleshooting a computer problem
    5·2 answers
  • Amy just added a 462 meter run of fiber optic cable to the network what should she do next?
    10·1 answer
  • Write a program that reads an integer, a list of words, and a character. The integer signifies how many words are in the list. T
    9·1 answer
  • Name all mario kart games in order
    15·2 answers
  • Cómo fue posible que los alemanes exterminando seres humanos​
    11·1 answer
  • What types of things were often NOT captured in early photographs?
    7·1 answer
  • 3. Which part of the computer is used<br> for typing?<br> a. Mouse<br> b. Keyboard
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!