Created
December 16, 2019 22:21
-
-
Save BNSby/eb2fdd9c99290c9ac2ee97200f7d124e to your computer and use it in GitHub Desktop.
Изучаем Dart 2019 / ДЗ по классам и наследованию / Задача 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
Cuboid cube = Cuboid(1, 2, 3); | |
} | |
class Cuboid { | |
int length, width, height; | |
Cuboid(this.length, this.width, this.height); | |
// возвращает площадь поверхности прямоугольного параллелепипеда | |
int get SurfaceArea { | |
return 2 * (length * width + length * height + width * height); | |
} | |
// возвращает объем кубоида (прямоугольного параллелепипеда) | |
int get Volume { | |
return length * width * height; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment