Question: Urgent help needed in java ! public class Rectangle { int width; int height; int calcArea() { return 0; // TODO } int calcPerimeter() {

Urgent help needed in java !

public class Rectangle {

int width;

int height;

int calcArea() {

return 0; // TODO

}

int calcPerimeter() {

return 0; // TODO

}

public static void main(String[] args) {

// 1. Add a constructor to the class that allows the width and height to be setup

// 2. Add the missing code to the methods so that they work correctly.

// 3. Create several instances of the Rectangle class and call the methods to test the code is working. hint: output info about each.

// 3. Add comments and 'private'/'public' modifiers where appropriate.

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!