Hello there,
I am currently enrolled in a computer science class at my school, and I need some help with a program.
My teacher started up a rocket club at our school with great success, but he needs some help with minor problems. He uses parachutes to bring his rockets safely back to the ground, but he wanted to know how much PSI a gram of gun powder produces. He wants me to create a program in java to determine the amount. I got everything working, but I can't seem to get an output if the amount of gunpowder is less than one gram.
I currently have the grams of powder set as a float variable and my equation for finding the PSI is set as :
Code:
psi = (grams * 100) / (0.04f * (rdia * rdia) * rlen);
(rdia is the radius of the rocket and rlen is the length of the rocket, both in inches.)
Also my output command is set as
Code:
outputLabel.setText("Your PSI is " + PSI);
I know that the equation is right as I have tried other programs out there to see if it works, but I can't get anything under 1 gram to print a result.