Introduction
I have been developing programs since 05
I am 11 yrs old
Calculator _10_DEMO_23-7-07_updated_.zip file includes a currency converter which uses google search to convert currencies
So donot mind my wrong english
I haven't explained the code
So try to develop a program like this and mail to r.anshul@gmail.com
Background and Features
1.Date and time in Menubar
2.Unit Converter ( In View --> Converter)
3.Temperature Converter ( In View --> Temperature Converter)
4.Area
and Volume Finder( In View Menu)
5.Fraction To Decimal and Fraction
Simplifier ( In View --> Fractions)
6.HCF or GCD Finder
7.LCM Finder
8.Operation Shower
9.Last Entered Number
10.PI Insertion
Please mail me if there are any other suggestions to improve it
Using the code
Using the code
As I have already told in the intro , Try to program by yourselves . If you want the code , mail me . r.anshul@gmail.com
(rad * math.pi) / 180
this is the rad to deg conversion
Fraction codes
They are well tested
Function dec2frac(ByVal dblDecimal As Double) As String
Dim intNumerator, intDenominator, intNegative As Integer
Dim dblFraction, dblAccuracy As Double
Dim txtDecimal As String
dblAccuracy = 0.1
txtDecimal = dblDecimal.ToString
For i As Integer = 0 To (txtDecimal.Length - 1)
If txtDecimal.Substring(i, 1) = "." Then
dblAccuracy = 1 / 10 ^ (txtDecimal.Length - i)
Exit For
End If
Next
intNumerator = 0
intDenominator = 1
intNegative = 1
If dblDecimal < 0 Then
intNegative = -1
End If
dblFraction = 0
Do While Math.Abs(dblFraction - dblDecimal) > dblAccuracy
If Math.Abs(dblFraction) > Math.Abs(dblDecimal) Then
intDenominator += 1
Else
intNumerator += intNegative
End If
dblFraction = intNumerator / intDenominator
Loop
Return intNumerator.ToString & "/" & intDenominator.ToString
End Function
Function num(ByVal dblDecimal As Double) As String
Dim intNumerator, intDenominator, intNegative As Integer
Dim dblFraction, dblAccuracy As Double
Dim txtDecimal As String
dblAccuracy = 0.1
txtDecimal = dblDecimal.ToString
For i As Integer = 0 To (txtDecimal.Length - 1)
If txtDecimal.Substring(i, 1) = "." Then
dblAccuracy = 1 / 10 ^ (txtDecimal.Length - i)
Exit For
End If
Next
intNumerator = 0
intDenominator = 1
intNegative = 1
If dblDecimal < 0 Then
intNegative = -1
End If
dblFraction = 0
Do While Math.Abs(dblFraction - dblDecimal) > dblAccuracy
If Math.Abs(dblFraction) > Math.Abs(dblDecimal) Then
intDenominator += 1
Else
intNumerator += intNegative
End If
dblFraction = intNumerator / intDenominator
Loop
Return intNumerator.ToString
End Function
Function den(ByVal dblDecimal As Double) As String
Dim intNumerator, intDenominator, intNegative As Integer
Dim dblFraction, dblAccuracy As Double
Dim txtDecimal As String
dblAccuracy = 0.1
txtDecimal = dblDecimal.ToString
For i As Integer = 0 To (txtDecimal.Length - 1)
If txtDecimal.Substring(i, 1) = "." Then
dblAccuracy = 1 / 10 ^ (txtDecimal.Length - i)
Exit For
End If
Next
intNumerator = 0
intDenominator = 1
intNegative = 1
If dblDecimal < 0 Then
intNegative = -1
End If
dblFraction = 0
Do While Math.Abs(dblFraction - dblDecimal) > dblAccuracy
If Math.Abs(dblFraction) > Math.Abs(dblDecimal) Then
intDenominator += 1
Else
intNumerator += intNegative
End If
dblFraction = intNumerator / intDenominator
Loop
Return intDenominator.ToString
End Function
Points of Interest
CONVERSIONS , AREAS , VOLUMES etc
History
Calculator 1.0