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
What type of account provides the same functions as managed service accounts but can be managed across multiple servers as in a
damaskus [11]

Answer:

group managed service account

Explanation:

A group managed service account gMSA is  a extension to the standalone Managed Service Account (sMSA). sMSA is a managed domain account that automates password management, simplifies service principal name (SPN) management and delegates  management to other administrators. it was introduced in Windows Server 2008 R2 and Windows 7.  However, the group Managed Service Account (gMSA) provides all the functionalities of an sMSA but also extends this functionality over multiple servers.

6 0
3 years ago
Write 5 things that can be done to avoid computer vision syndrome
weeeeeb [17]
Get a comprehensive eye exam.
Use proper lighting.
Minimize glare.
Upgrade your display.
Adjust your computer display settings
Blink more often.
Exercise your eyes.
Take frequent breaks.
6 0
3 years ago
Read 2 more answers
Research and recommend the most appropriate VPN technology. The most likely solution is either an Internet Protocol Security (IP
chubhunter [2.5K]

Answer:

The five eras are general- purpose mainframe and minicomputer computing, personal computers, client/server networks, ...

7 0
3 years ago
Read an integer from keyboard and then print the result of the sum obtained by adding the entered integer to the integer formed
Stels [109]

Answer:

Following are the program in C++ language

#include <iostream> // header file

using namespace std; //  namespace std;

int main() // main function

{

int number,n1,rem; // variable declaration

int sum,sum1=0;// variable declaration

cout<<"Enter the number :";

cin>>number;// Read the number

n1=number; // initialized the value of number with the n1

while(n1>0) // iteating the  while loop

{

   rem=n1%10; // finding the reminder

   sum1=10*sum1+rem;  // storing the sum

   n1=n1/10;

}

sum=sum1+number; // calculate the sum

cout<<"The sum is:"<<sum; // Display sum

   return 0;

}

Output:

Enter the number :123

The sum is:444

Explanation:

Following are the Description of the Program

  • Read the value of "number" in the "number" variable of int type .
  • Initialized the value of "number" in the "n1' variable.
  • Iterating the while loop until the n1>0.
  • In this loop we reverse the number in the "sum1" variable
  • Finally print the sum in the "sum" variable

3 0
3 years ago
Instructions:Select the correct answer.
balandron [24]
The answer is installing antivirus software
3 0
2 years ago
Other questions:
  • Do most facebook and twitter users access the platform from their personal computers?
    6·2 answers
  • If you add the parameter, ____, the text in the applet window fades in and out as it scrolls.
    7·1 answer
  • George, a user, has contacted you to complain that his issue has not been resolved. He has already contacted your department twi
    9·1 answer
  • ____ documents consist of the text to be displayed on a Web page, together with a number of special characters: tags that achiev
    14·1 answer
  • Explain what is meant by information technology (IT). Explain what is meant by information systems (IS). Why is it important to
    7·1 answer
  • Which media example would be best for mayas presentation
    7·1 answer
  • ...................is a high level, structured , open source programming language​
    10·1 answer
  • What types of printed information are useful to obtain from your target employers?
    5·1 answer
  • Select each of the steps involved in creating a table in a presentation.
    12·1 answer
  • This method of file transfer has been used for decades and is frequently used for uploading changes to a website hosted by an in
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!