class leygravitacion
{
//atributos
double m1;
double m2;
double d;
leygravitacion()
{
}//constructor
leygravitacion(double x, double y, double z)
{
m1=x;
m2=y;
d=z;
}//constructor de inicializacion
void set_m1 (double x)
{
m1=x;
}
void set_m2 (double y)
{
m2=y;
}
void set_d (double z)
{
d=z;
}
double calc_fza()
{
double f;
final double g=6.673E-8;
f=(g*m1*m2)/(d*d);
return (f);
}
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.