Created
February 23, 2023 19:36
-
-
Save DemianRamirezR/bd1dc7b465d379c5f4520adb061f556d to your computer and use it in GitHub Desktop.
calculamos el area y perimetro del rectangulo
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
//programacion orientada a objetos | |
class Figura{ | |
//Atributos | |
double? base; | |
double? altura; | |
//Funciones | |
void datosfigura(){ | |
print("Base: $base"); | |
print("Altura: $altura"); | |
} | |
void perimetro(){ | |
double p; | |
p= base! * 2 + altura!*2; | |
print("El Perimetro es igual a: $p"); | |
} | |
void area(){ | |
double a; | |
a = base! * altura!; | |
print("El Area es igual a: $a"); | |
} | |
} | |
void main() { | |
print("Ramirez Ramirez Jose Demian 6to I"); | |
Figura rectangulo = Figura(); | |
rectangulo.base = 8; | |
rectangulo.altura = 4; | |
rectangulo.datosfigura(); | |
rectangulo.perimetro(); | |
rectangulo.area(); | |
}//fin de main |
Author
DemianRamirezR
commented
Feb 23, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment