Lunes 06 de octubre de 2008 a las 09:44
hoOlaaa
tengo un problemon
soy nueva en c# y no le agarro muy bien la onda
y tengo que entregar un trabajo hoy de un circulo en aplicacion consola
el circulo se encuentra dentro de un cuadrado de 800x800 y lo tengo que mover y si esta dentro de los parametros permitirle moverse si no me regrese un booleano falso, bueno esa es la idea, necesito ayudaaaa
tengo varios errores estos son los que me aparecen con mas frecuencia:
1. Se esperaba una clase, un delegado, una enumeración, una interfaz o una estructura
2. Ninguna sobrecarga para el método \'Pow\' acepta \'1\' argumentos
y no se que significan no se que hacer con ellos
aqui esta todo mi codigo
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
public class Punto
{
private double xc;//atributos
private double yc;//atributos
public double x;//atributos
public Punto()
{
this.xc = Xc;
this.yc = Yc;
}
public double Xc //propiedades
{
get
{
return this.xc;
}
set
{
this.xc = value;
}
}
public double Yc //propiedades
{
get
{
return this.yc;
}
set
{
this.yc = value;
}
}
}
class Circulo
{
private punto Pc = new Punto();
private double A;
private double P;
private double R;
public double radio
{
set
{
this.radio = value;
if ((value > 0) && (value + Pc.x <800) && (value + Pc.y <800) && (value- Pc.x>=0)&&(value-Pc.y>=0))
{
A = (Math.PI * Math.Pow (this.radio));
R = value;
P = 2 * Math.PI * radio;
}
}
get
{
return R;
}
}
public double area
{
set
{
this.area = value;
if ((value > 0) && (Pc.x + Math.Sqrt((value / Math.PI) <= 800)))
{
A = value;
R = Math.Sqrt(value / Math.PI);
P = 2 * Math.PI * radio;
}
}
get
{
return A;
}
}
public double perimetro
{
set
{
this.perimetro = value;
if ((value > 0) && (Pc.x + ((value / (2 * Math.PI)) <= 800) && (Pc.y + ((value / (2 * Math.PI)) <= 800) && (Pc.x - ((value / (2 * Math.PI)) >= 0) && (Pc.y - ((value / (2 * Math.PI)) >= 0))))))
{
P = value;
A = Math.PI * Math.Pow(radio);
R = Math.Sqrt(value /Math.PI);
}
}
get
{
return P;
}
}
}
public bool goto xy(double NVx, NVy)
{
if((((NVy>0)&&(NVx>0)&&(NVx+this.radio)<=800)&&((NVx-this.radio)>=0)&&(NVy+this.radio)<=800)&&((NVy-this.radio)>=0))
{
NVx=Pc.x;
NVy=Pc.y;
}
get
{
return true;
}
else
return false;
}
public void inicializa()
{
Pc.x=1;
Pc.y=1;
A =System.Math.PI;
P=6.283185307;
R=1;
}
[STAThread]
static void Main(string[] args)
{
Circulo Rueda = new Circulo();
Console.WriteLine(\"Teclee el radio del circulo\");
Rueda.Radio=float.Parse(Console.ReadLine());
Rueda.Perimetro=float.Parse(Console.ReadLine());
Rueda.Area=float.Parse(Console.ReadLine());
Console.WriteLine(\"el area es: {0}\", Rueda.Area());
Console.WriteLine(\"el perimetro es: {0}\", Rueda.Perimetro());
Console.WriteLine(\"El radio es: {0}\", Rueda.Radio());
System.Console.ReadKey();
}
}