package General;
public class FoxMcDonald extends AirProperties
{ public double altitude;
// Air physical properties determined as function of the altitude } AirProperties airprop = new AirProperties();
{ if (0.0 <= altitude && altitude < 500.0)
{ airprop.setDenChar(1.22500e0);
airprop.setPrChar(1.01325e5);
airprop.setMiChar(1.78962e-5);
airprop.setKChar(2.53154e-2); }
if (500.0 <= altitude && altitude < 1000.0 )
{ airprop.setDenChar(1.16730e0);
airprop.setPrChar(9.54583e4);
airprop.setMiChar(1.77366e-5);
airprop.setKChar(2.50533e-2); }
{-----------------------------------------------------------------------------------}
package General;
public class NasaSP8010 extends AirProperties
{ public double altitude;
private double achar;
// Air physical properties determined as function of the altitude }
AirProperties airprop = new AirProperties();
{ if (0.0 <= altitude && altitude < 2000.0)
{ airprop.setDenChar(1.26e-2);
airprop.setPrChar(4.96e2);
airprop.setMiChar(1.06e-5);
airprop.setKChar(2.53154e-2);
achar = 230.0e0; }
if (2000.0 <= altitude && altitude < 4000.0)
{ airprop.setDenChar(1.04e-2);
airprop.setPrChar(4.11e2);
airprop.setMiChar(1.06e-5);
airprop.setKChar(2.50533e-2);
achar = 230.0e0; }
{-----------------------------------------------------------------------------------}
package General;
public class AirProperties
// Definition of variables
{ private double denChar;
private double prChar;
private double miChar;
private double kChar;
private double reChar;
private double reSigma;
private double rb;
private double dtChar;
// Definition of methods public double getDenChar()
{ return this.denChar; }
public void setDenChar(double denChar)
{ this.denChar = denChar; }
{-----------------------------------------------------------------------------------}
package General;
public class Atmosphere
{ public static void main (String[] args)
{ GeneralProperties genprop = new GeneralProperties();
String formulation = genprop.getFormulation();
PhysicalProperties phyprop = new PhysicalProperties();
double altitude = phyprop.getAltitude();
// Defining the air properties in the Earth atmosphere
if ((formulation == "TECNE") || (formulation == "TCNE"))
{ FoxMcDonald(); }
else
// Defining the air properties in the Mars atmosphere
{ NasaSP8010(); } }
// This finalizes the atmosphere properties
Ai está as 4 classes que fazem parte desta parte do código. Espero que me ajude. Eu também estou tendo dificuldades com a definição de variáveis, o Eclipse toda vez está colocando que as variáveis devem ser colocadas como do tipo final. Aguardo seu retorno, obrigado, Edisson Sávio.