help convert something simple to java from vb

• 05-11-2012, 04:06 PM
coreyk67
help convert something simple to java from vb
I'm a total newb and need help doing a conversion from vb to java. its a hydrometer calibration formula.

Code:

```Function sgRatio(Temp As Double) As Double     sgRatio = 1.00130346 - 0.000134722124 * Temp + 0.00000204052596 * Temp ^ 2 - 2.32820948E-09 * Temp ^ 3 End Function Function corSG(SG As Double, Temp As Double, CalT As Double) As Double     corSG = SG * (sgRatio(Temp) / sgRatio(CalT)) End Function```

Layman instructions.

C = ((1.313454 - (0.132674*F) + (0.00205779 * F^2) - (0.000002627634 * F^2)))

Where F = Temperature in degrees Fahrenheit.

C = Correction

So,

CG = C + (SG * 0.001)

Where,

CG = Specific Gravity corrected for temperature

C = Correction from above forumla

SG = Specific Gravity before temperature correction.

Thanks in advance... this is not homework, just me messing around :)
• 05-11-2012, 04:17 PM
DarrylBurke
Re: help convert something simple to java from vb
All the help you'll need to make a start can be found in The Java™ Tutorials

And it doesn't make any difference whether it's homework or not, this is a forum -- not a code mill. We're prepared to help you learn, not to do your work for you.

db
• 05-11-2012, 05:14 PM
coreyk67
Re: help convert something simple to java from vb
Just figured I could learn from an example. Thanks anyways Mr. catty :)
• 05-11-2012, 05:28 PM
chipp
Re: help convert something simple to java from vb
OOT: since when db becomes "catty"?
• 05-11-2012, 05:44 PM
JosAH
Re: help convert something simple to java from vb
Quote:

Originally Posted by chipp
OOT: since when db becomes "catty"?

For no particular reason, db prefers the nick name Tarquin Fin Tim Lin Bin Whin Bim Lim Bus Stop F’tang F’tang Olé Biscuitbarrel.

kind regards,

Mrs Elsie Zzzzzzzzzzzzzzzzzzt! (slightly silly, 1204 points)
• 05-11-2012, 07:43 PM
DarrylBurke
Re: help convert something simple to java from vb
The whole shebang is plagiarized
Temp Correction Formula for Hydrometer - Page 3 - Home Brew Forums
Temp Correction Formula for Hydrometer - Page 2 - Home Brew Forums

Guess the mouse is going to have to buckle down and do its own homework.

OT, it's time for me to change my signature.

db