AssignmentS2
This commit is contained in:
19
assignments/AssigmentS2/exercise2-1/Rectangle.java
Normal file
19
assignments/AssigmentS2/exercise2-1/Rectangle.java
Normal file
@ -0,0 +1,19 @@
|
||||
public class Rectangle implements Shape {
|
||||
|
||||
// private double n;
|
||||
|
||||
/* public Circle(double n) {
|
||||
this.n = n;
|
||||
}
|
||||
*/
|
||||
public double calculateArea(double n, double m) {
|
||||
return m*n;
|
||||
|
||||
}
|
||||
|
||||
public double calculatePerimeter(double n, double m) {
|
||||
return 2*m + 2*n;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user