Skip to content

Instantly share code, notes, and snippets.

@AbraaoAlves
Created April 19, 2016 16:40
Show Gist options
  • Select an option

  • Save AbraaoAlves/82b37799cdaab0a0df868ab16caea5b7 to your computer and use it in GitHub Desktop.

Select an option

Save AbraaoAlves/82b37799cdaab0a0df868ab16caea5b7 to your computer and use it in GitHub Desktop.
dart code sample
import 'dart:math' as Math;
class Circulo {
int ri;
Circulo(int r){
this.ri = r;
}
calcularArea(int r){
return Math.PI * Math.pow(r, 2);
}
}
class CoroaCircular extends Circulo{
int re;
CoroaCircular(int r, int re): super(r) {
this.re = re;
}
calculaAreaDaCoroa(){
return this.calcularArea(this.re) - this.calcularArea(this.ri);
}
}
void main() {
var x1 = 10;
var x2 = 20;
var cc = new CoroaCircular(x1, x2);
print("area = " + cc.calculaAreaDaCoroa().toString());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment