# Thread: help convert something simple to java from vb

1. Member
Join Date
May 2012
Posts
2
Rep Power
0

## 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.

Java 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 :)

2. ## 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

3. Member
Join Date
May 2012
Posts
2
Rep Power
0

## Re: help convert something simple to java from vb

Just figured I could learn from an example. Thanks anyways Mr. catty :)

4. ## Re: help convert something simple to java from vb

OOT: since when db becomes "catty"?

5. ## Re: help convert something simple to java from vb

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)

6. ## 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

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•