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]
2 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]2 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
In this class, it is very common for your computer screen to look like this. What is this?​
Vsevolod [243]
Theres no Picture???
8 0
2 years ago
How are < embed > tags used in web page creation?
yKpoI14uk [10]

Answer:

The <embed> HTML element embeds external content at the specified point in the document. This content is provided by an external application or other source of interactive content such as a browser plug-in.

Explanation:

7 0
2 years ago
Draw a flow chart that accepts mass and volume as input from the user. The flow chart should compute and display the density of
TiliK225 [7]

Answer:

See attachment for flowchart

Explanation:

The flowchart is represented by the following algorithm:

1. Start

2. Input Mass

3. Input Volume

4 Density = Mass/Volume

5. Print Density

6. Stop

The flowchart is explained by the algorithm above.

It starts by accepting input for Mass

Then it accepts input for Volume

Step 4 of the flowchart/algorithm calculated the Density using the following formula: Density = Mass/Volume

Step 5 prints the calculated Density

The flowchart stops execution afterwards

Note that the flowchart assumes that the user input is of number type (integer, float, double, etc.)

6 0
3 years ago
Smallest kind of computer
jeka57 [31]
I don’t know if i’m right but like Michigan Micro Mote ?
3 0
1 year ago
Read 2 more answers
"Hubs:
Butoxors [25]

Answer:

Hubs incorporate amplifiers and repeaters.

Explanation:

Hub is an outdated way of connecting ethernet devices, they incorporate amplifiers and repeaters, they do not allow simultaneous communication among connected devices.

The latest technology in connecting ethernet devices are with the use of switch.

7 0
3 years ago
Other questions:
  • 1.
    13·1 answer
  • When creating a software package, the software must be designed, the code must be written, and then the code must be tested. Thi
    6·1 answer
  • A. True
    8·2 answers
  • There are several methods of updating information and data on a webserver. We must consider who performs those updates upfront w
    9·2 answers
  • Store programming components in the shared folder. you want to secure the data in the folder as follows: members of the research
    11·1 answer
  • How do you know if a remote host is alive or not?
    5·1 answer
  • Before the electronic era information was usually directly communicated and not recorded, much of the information you received w
    9·1 answer
  • Write a MATLAB program to accomplish the following: Create two vectors, a and b, where vector a contains all positive integers l
    10·1 answer
  • This is pixlr
    6·1 answer
  • Widow in respect to word processing ​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!