ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

#VERTICE


Enviado por   •  5 de Marzo de 2019  •  Informes  •  1.244 Palabras (5 Páginas)  •  331 Visitas

Página 1 de 5

#VERTICE

using System;

using System.Collections.Generic;

using System.Text;

namespace tp1_6

{

public class Vertice

{

private int x;

private int y;

// constructor del vertice

public Vertice(int n1, int n2)

{

this.x = n1;

this.y = n2;

}

// las propiedades X e Y

public int X

{

set { x = value; }

get { return x; }

}

public int Y

{

set { y = value; }

get { return y; }

}

}

}

#RECTANGULO

using System;

using System.Collections.Generic;

using System.Text;

namespace tp1_6

{

public class Rectangulo

{

private Vertice a;

private Vertice b;

private Vertice c;

private Vertice d;

private int altura;

private int bace;

//constructor a partir de los 4 vertices

public Rectangulo(Vertice v1, Vertice v2, Vertice v3, Vertice v4)

{

this.A = v1;

this.B = v2;

this.c = v3;

this.d = v4;

}

//constructor a partir de base y altura

public Rectangulo(int ba,int alt)

{

this.a = new Vertice(0, 0);

this.b = new Vertice(this.v1.getX(), base);

this.c = new Vertice(altura, this.v2.getY());

this.d = new Vertice(this.v3.getX(), this.v1.getY());

}

//----------------propiedades de base y altura------------

public int Altura

{

set { altura = value; }

get { return altura; }

}

...

Descargar como (para miembros actualizados)  txt (3.3 Kb)   pdf (34.6 Kb)   docx (9.1 Kb)  
Leer 4 páginas más »
Disponible sólo en Clubensayos.com