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
What can i use to erase data off computer and what name of it and steps
swat32
Is it mac i know how
5 0
3 years ago
Explain the importance of electronics on our daily lives”? 5 sentences minimum
zimovet [89]

Answer:

through electronics we have a electrified lighted world. our homes,are lit with light using electricity. the stereo we listen to, electricity makes it happen. tv,computers, and record turntables all need electricity. electricity makes things possible that would otherwise be either impossible or very arduous. we see sounds and enjoy them. we watch entertaining movies. we read books and do our homework with the appreciated help of electricity.

8 0
3 years ago
Clickable text or images that take you to different sites on the World Wide Web are called __________.
andrew-mc [135]

they are called links my dear watson

6 0
3 years ago
Read 2 more answers
What type of file format is PSD?
Ronch [10]

Answer:

PSD (Photoshop Document)

Explanation:

PSD (Photoshop Document) is an image file format native its one of Adobe's popular Photoshop Application. PSD files are commonly used for containing high quality graphics data.

8 0
3 years ago
Read 2 more answers
Describe how sharing and collaborating a spreadsheet can help the author of the spreadsheet.
Reika [66]
It can help ensure that everything is correct. Having an extra set of eyes can never hurt :)
3 0
3 years ago
Other questions:
  • How do I change my age on here?-<br> Why did it set it to 18???
    5·2 answers
  • According to your textbook, the three major criteria against which to test documents that you locate on the Internet are authors
    8·1 answer
  • Write a function get_initials(the name) that takes a string of a name and returns the initials of the name, in upper case, separ
    12·1 answer
  • The steps for moving data from one cell to another are _____.
    14·1 answer
  • Who can pick up GPS signals
    14·1 answer
  • A prime number is an integer greater than 1 that is evenly divisible by only 1 and itself. For example, the number 5 is prime be
    11·1 answer
  • Which job role requires you to set up an internet system access
    10·1 answer
  • How do I delete my brainly account?<br> I don't need anymore.
    13·2 answers
  • LAB: Parsing dates in M/D/Y format
    5·1 answer
  • A person who breaks into a computer, network, or online site is called
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!