Answer:
Step-by-step 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;
}
}