You are on page 1of 2

Scanner input = new Scanner(System.

in);
DecimalFormat numberFormat = new DecimalFormat("#.0000");

System.out.printf("Enter Mass in lbm:");


double Mass = input.nextDouble();

System.out.printf("Enter Volume in ft^3:");


double Volume = input.nextDouble();

System.out.printf("Enter Diameter in ft:");


double Diameter = input.nextDouble();

System.out.printf("Velocity in ft/s:");
double Velocity = input.nextDouble();

System.out.printf("Enter Viscosity in ft-lbm/s^2:");


double Viscosity = input.nextDouble();

double Density = Mass/Volume;


System.out.println("Density is = " + numberFormat.format(Density));

double Density2 = ((Density*3.28*3.28)/2.204);


System.out.println("The Density in kg/m^3 = " + Density2);

double kg = Mass/2.204;
System.out.println("The Mass in Kg = " + numberFormat.format(kg));

double cubic = (Volume/3.28);


System.out.println("The Volume in m^3 = " + numberFormat.format(cubic));

double speed = Velocity/3.28;


System.out.println("The Velocity in m/s = " + numberFormat.format(speed));

double size = Diameter/3.28;


System.out.println("The Diameter in m = " + numberFormat.format(size));

double viscous= Viscosity/(3.28*2.204);


System.out.println("The Viscosity in kg-m/s^2 = " +
numberFormat.format(viscous));

double Reynolds = ((Density*Volume*Diameter)/Viscosity);


System.out.println("Reynolds number is = " +
numberFormat.format(Reynolds));

int x = 2100;
int y = 4000;

if (Reynolds <= 2100)


{
System.out.printf("The Flow is Laminar");
} else
{
if (Reynolds >= 4000)
{
System.out.printf("The Flow is Turbulent");
} else
{
System.out.printf("The Flow is Transitional");
}
}

You might also like