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
Get step-by-step solutions from verified subject matter experts
