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 is NOT a component of a relationaldatabase?
MaRussiya [10]

Answer: 4) Hierarchy

Explanation:

The main components of the relational database are table, entity and attributes. As, relational data base is the method of arranging and maintaining the data and each table in the database contain data in the entity and the attributes. Hierarchy is not the component of the database as it is included in the type oh hierarchical database not in relational database.

5 0
4 years ago
The market for social-networking website services is characterized by network externalities because: Choose one:
ale4655 [162]

Answer:

Option C is the correct answer to the following question.

Explanation:

Because network externality is that in which a consequence of the industrial activities or the other commercial activities which are affects another parties without involving the reflected in cost of goods and services. The other folks used the website as compares to any other folks enjoys. So, that's why it is correct.

7 0
4 years ago
When on a LAN switch DHCP snooping is configured the networks that can be accessed by which clients?
kompoz [17]

Answer:

The network is accesible just for the whitelisted clients configured in the switch connected to the DHCP server

Explanation:

DHCP snooping main task is to prevent an unauthorized DHCP server from entering the our network.

Basically, in the switch we define the ports on which the traffic of the reliable DHCP server can travel. That is, we define as “trust” the ports where we have DHCP servers, DHCP relays and trunks between the switches.

8 0
4 years ago
I really need help with coderZ does anyone kno?
vesna_86 [32]

Answer:

Easy-to-use virtual robotics and STEM platform tailored to serve every student at every level!

CoderZ is a powerful, award-winning online platform.

Explanation:

CoderZ is a powerful, award-winning online platform through which students learn valuable STEM skills such as coding, robotics, and physical computing. CoderZ is highly flexible and designed for use in the classroom or through a wide range of remote learning environments.  Computers and technology are everywhere. Studying science, technology, engineering and math gives kids valuable skills for the future and develop life-skills like computational thinking, critical thinking and problem-solving as well.

STEM and CS education focuses on how to approach complex problems, break down the challenges into small pieces and approach resolving them in a logical manner – critical skills for any career path.

4 0
3 years ago
Write a loop that counts the number of space characters in a string. Recall that the space character is represented as ' '.
Jlenok [28]

Answer:

I am writing Python program.

string = input("Enter a string: ")

print(string.count(' '))

Explanation:

The first statement takes input string from the user.

input() is used to read the input from the user.

The next statement uses count() function to count the number of times the specified object which is space ' ' here occurs in the string.

The print() function is used to return the number of times the space occurs in the string entered by the user.

Output:

Enter a string: How are you doing today?

4

The screenshot of program and its output is attached.

3 0
4 years ago
Other questions:
  • Mitchell has noticed that his co-workers are unable to open attachments in the emails he sends. What is one possible reason for
    5·1 answer
  • MTV can now be seen by most of the world's population. This is an example of
    7·1 answer
  • WILL MARK BRAINLYIST
    15·2 answers
  • What type of rain happens when cold air meets warm air
    14·1 answer
  • What does CPL stand for
    9·2 answers
  • When you use a mouse to select a row or column in a table, word displays a(n) ____?
    5·1 answer
  • A major weakness of a lot of file processing systems is that ____.
    10·1 answer
  • On many advanced routers and switches, you can implement QoS through bandwidth management, such as __________, where you control
    5·1 answer
  • Describe the functions of ALU, resisters, CU, BIU, Cache and FPU.
    7·1 answer
  • What software would you recommend for design?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!