Informatica

Solo disponible en BuenasTareas
  • Páginas : 2 (403 palabras )
  • Descarga(s) : 0
  • Publicado : 23 de mayo de 2011
Leer documento completo
Vista previa del texto
public class Cuadrado extends FigurasG{
double lado;
Cuadrado(){
}
Cuadrado(double l){
lado=l;
}
public double perimetro(){
return(4*lado);
}
public double perimetro(double l){return(4*l);
}
public double area(){
return(Math.pow(lado,2));
}
public double area(double l){
return (math.pow(l,2));
}
}
public class Rectangulo extends FigurasG{
double base,altura;
rectangulo(){}
Rectangulo(double b, double h){
base=b;
altura=h;
public double perimetro(){
return(2*(base+altura));
}
public(double perimetro(double b, double h){
return(2*(b+h));
}
public doublearea(){
return(base*altura);
}
public double area (double b, double h){
return(b*h);
}
}
public class Triangulo extends FigurasG{
double base, altura, ladoa, ladoc;
Triangulo(){
}Triangulo(double a, double b, double c, double h){
base=b;
altura=h;
ladoa=a;
ladoc=c;
}
public double perimetro(){
return(base+ladoa+ladoc);
}
public double perimetro(double a, double b, double c){return(a+b+c);
}
public double area(){
return(base*altura)/2;
}
public double area(double b, double h);
return (b*h)/2;
}
}
public class Circulo extends FigurasG{
private final double pi=3.1416;double radio;
Circulo(){
}
Circulo(double r){
radio=r;
}
public double perimetro(){
return(2*(pi*r));
}
public double area(){
return((pi)*Math.pow(radio 2)));
}
public double area(doubler){
return(pi*Math.pow(r.2));
}
}
public class Cubo extends FigurasG{
double lado;
Cubo(){
}
Cubo(double l){

lado=l;
}
public double Volumen(double l){
return Math.pow(l.3);
}
publicdouble Abase(double l){
return (4*Math.pow(l.2));
}
public double Asup(double l){
return(6*Math.pow(l.2));
}
}
public class Paralelepipedo extends FigurasG{
double(ladoa, ladob,ladoc);Paralelepipedo(){
}
Paralelepipedo(double a,b,c);
ladoa=a;
base=b;
ladoc=c;
}
public double volumen(double a,double b, double c){
return(a*b*c);
}
public double Abase(double a, double b){...
tracking img