AssignmentS2

This commit is contained in:
2025-02-25 01:41:01 +03:00
parent 2c4a3a53b9
commit c6f3123b73
12 changed files with 167 additions and 0 deletions

View File

@ -0,0 +1,17 @@
class Rectangle implements Shape {
private double n, m;
public Rectangle(double n, double m) {
this.n = n;
this.m = m;
}
public double calculateArea() {
return n*m;
}
public double calculatePerimeter() {
return 2*n+2*m;
}
}