01-Interface.js


Dosyayı İndir
var RightPrism = /** @class */ (function () {
    function RightPrism(name, width, height, depth) {
        this.name = name;
        this.width = width;
        this.height = height;
        this.depth = depth;
    }
    RightPrism.prototype.getArea = function () {
        return 2 * (this.width * this.height + this.width * this.depth + this.height * this.depth);
    };
    RightPrism.prototype.getVolume = function () {
        return this.width * this.height * this.depth;
    };
    return RightPrism;
}());
var Cylinder = /** @class */ (function () {
    function Cylinder(name, radius, depth) {
        this.name = name;
        this.radius = radius;
        this.depth = depth;
    }
    Cylinder.prototype.getArea = function () {
        return 2 * Math.PI * this.radius * this.radius + 2 * Math.PI * this.radius * this.depth;
    };
    Cylinder.prototype.getVolume = function () {
        return Math.PI * this.radius * this.radius * this.depth;
    };
    return Cylinder;
}());
var rightPrism = new RightPrism("Dikdörtgen Prizma", 3, 4, 12);
console.log(rightPrism.name + " Alan: " + rightPrism.getArea() + " Oylum: " + rightPrism.getVolume());
var cylinder = new Cylinder("Silindir", 3, 12);
console.log(cylinder.name + " Alan: " + cylinder.getArea() + " Oylum: " + cylinder.getVolume());
function writeRigidBody(rigidBody) {
    console.log(rigidBody.name + " Alan: " + rigidBody.getArea() + " Oylum: " + rigidBody.getVolume());
}
var rigidBody1 = new RightPrism("Dikdörtgen Prizma", 3, 4, 12);
writeRigidBody(rigidBody1);
var rigidBody2 = new Cylinder("Silindir", 3, 12);
writeRigidBody(rigidBody2);

				
Dosyayı İndir

Bu Sayfayı Paylaş:




Bu Sayfayı Paylaş:

İletişim Bilgileri

Takip Et

Her Hakkı Saklıdır. Bu sitede yayınlanan tüm bilgi ve fikirlerin kullanımından fibiler.com sorumlu değildir. Bu sitede üretilmiş , derlenmiş içerikleri, fibiler.com'u kaynak göstermek koşuluyla kendi sitenizde kullanılabilirsiniz. Ancak telif hakkı olan içeriklerin hakları sahiplerine aittir