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
solong [7]
3 years ago
7

Implement a class Rectangle. Provide a constructor to construct a rectangle with a given width and height, member functions get_

perimeter and get_area that compute the perimeter and area, and a member function void resize(double factor) that resizes the rectangle by multiplying the width and height by the given factor
Computers and Technology
1 answer:
Luba_88 [7]3 years ago
3 0

Answer:

Explanation:

The following code is written in Java. It creates the Rectangle class with the height and width variables. The constructor takes these variables as parameters to create Rectangle objects. It creates the get_perimeter method that sums up two of each side in order to get the perimeter of the Rectangle. A get_area method multiplies the height by the width to get the area. Finally, a resize method takes in a double factor variable and multiplies the height and the width by the factor to get a resized Rectangle object.

class Rectangle {

   double height, width;

   public Rectangle(double height, double width) {

       this.height = height;

       this.width = width;

   }

   

   public double get_perimeter() {

       return (this.height + this.height + this.width + this.width);

   }

   

   public double get_area() {

       return (this.height * this.width);

   }

   

   public void resize(double factor) {

       this.height *= factor;

       this.width *= factor;

   }

}

You might be interested in
<img src="https://tex.z-dn.net/?f=%5Cmathcal%7B%5Cfcolorbox%7Bblue%7D%7Byellow%7D%7B%5Cred%7BQUESTIONS%3A%7D%7D%7D" id="TexFormu
Paraphin [41]

Answer:

1. A computer network is a set of computers sharing resources located on or provided by network nodes. The computers use common communication protocols over digital interconnections to communicate with each other.

2. A computer network comprises two or more computers that are connected—either by cables (wired) or WiFi (wireless)—with the purpose of transmitting, exchanging, or sharing data and resources

3. LANs are only designed to connect devices. ... In comparison, WANs can connect all of these same devices as well as LANs. In other words, a WAN can connect multiple LANs together so that all of their respective devices can communicate with each other. WANs are also more difficult to set up and maintain than LANs

Explanation:

hope this helps u

4 0
3 years ago
Read 2 more answers
Within a single program, __________________ allows multiple parts, or threads, to run simultaneously.
jekas [21]
<span>It should be single-user/multitasking os.</span>
4 0
4 years ago
You can print powerpoint presentation handouts with up to ____ slides per page.
Ierofanga [76]
You can print up to 9 slides per page.
3 0
4 years ago
1. Write a generic method that compares its 2 arguments using the equals method and returns true if they are equal and false oth
Ganezh [65]

Answer:

Explanation:

The following piece of code is written in Java. It creates the method as requested that takes in two generic objects and compares them using the .equals() built in Java method. This method will return True if the objects are identical or False if they are not. A test case is used in the code and the output can be seen in the attached image below.

   public static <T> boolean comparePerez(T a, T b) {

       return a.equals(b);

   }

5 0
3 years ago
How to find the average range of cells A1:A10
Ad libitum [116K]
Go to a blank cell and type

         =AVERAGE(A1:A10)      then  <ENTER>

As if by magic, the average of those cells
will appear where you typed the formula.
5 0
3 years ago
Other questions:
  • When you schedule an appointment, Outlook adds the appointment to the ____ folder by default.
    9·1 answer
  • I plugged my headphones into my computer, but the sound still came out of the speakers. help!
    12·2 answers
  • Charlie is a British national who works in the United States as a novelist for children. Because he is British, he types the wor
    10·2 answers
  • Now let's create a memo. The memo should include all parts of a memo, and these parts should appear in the correct order. In you
    9·1 answer
  • Convert 311 from decimal to hexadecimal. Show your work.
    9·1 answer
  • What is a sequence of graphic illustrations which represent the planned scenes for a video or animation?
    6·2 answers
  • Which is a connectionless protocol in the transport layer? What are the small chunks of data called?
    12·2 answers
  • What does it mean to influence the government? Use influence in a sentence.
    8·2 answers
  • What is a query? State it's uses.​
    8·1 answer
  • Shouldn't I be virtuoso? I keep refreshing and opening and closing tabs but it still hasn't updated
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!