Rounding Currency

Many of my friends at University has request me to post the homework code of that I have done on my blog. and here the simple Console Application that i’m learning at University. So I hope that younger or older brother that learning in IT can see the simple code and correct or implement it together.

-The Code are focus on how to use “IF Condition” and “Do Loop”.
Here is the Rounding Currency Code In Console Application

Module Module1

Sub Main()

Dim ROUND As Double
Dim amount As Double
Dim selected As Integer
Dim modulus As Double
Dim yesno As String

Console.WriteLine(“Rounding Currency Table”)
Console.WriteLine(“Please Select the Currency”)
selected = Console.ReadLine

If (selected = 1) Then
Console.WriteLine(“Input Amount:”)
amount = Console.ReadLine
modulus = amount Mod 100

If (modulus = 50) Then
ROUND = amount
ElseIf (modulus > 50) Then
ROUND = (amount – modulus) + 100
ElseIf (modulus < 50) Then
ROUND = amount – modulus
End If
Console.WriteLine(“Rounded Amount={0}Riel”, ROUND)
ElseIf (selected = 2) Then
Console.WriteLine(“Input Amount”)
amount = Console.ReadLine
Console.WriteLine(“Rounded Amount={0} USD”, amount)
ElseIf (selected = 3) Then
Console.WriteLine(“Input Amount”)
amount = Console.ReadLine
Console.WriteLine(“Rounded Amount={0} EURO”, amount)
ElseIf (selected = 4) Then
Console.WriteLine(“Input Amount”)
amount = Console.ReadLine
Console.WriteLine(“Rounded Amount={0} POUND”, amount)
Console.WriteLine(“Wrong Selection”)
End If
Console.WriteLine(“Do you want to continue (Y|N)? “)
yesno = Console.ReadLine

Loop Until (yesno = “n”)

End Sub

End Module

If you have any problem of running the program or need to ask inside code, please fill free to ask me. I might be available from my best tried.

8 thoughts on “Rounding Currency

  1. That right. If you decide to get something illegal, You have to be facing with something illegal on you back.

    Rapidshare allow you download one file(100Mb) per day. Sometime after few day pass it still say “your IP Address just download some file from it…” so you can not download.

    Rapidshare is Secure but Take time. if you want to get it fast, I recommence you use Bit Torrent to download , Because the speed is depending on the number of seeder and leecher.

  2. If you wanna download software from Torrent you also have to upload something from your computer. That is a very dangerous because you might loss some important data.

    For me, I choose to download software from Rapidshare or Megaupload. If you want to find software to download just type : Rapidshare (softwarename) in google search box than you might be able to find the link to download.


Fill in your details below or click an icon to log in:


អ្នក​កំពុង​បញ្ចេញ​មតិ​ដោយ​ប្រើ​គណនី របស់​អ្នក​។ Log Out / ផ្លាស់ប្តូរ )

រូប Twitter

អ្នក​កំពុង​បញ្ចេញ​មតិ​ដោយ​ប្រើ​គណនី Twitter របស់​អ្នក​។ Log Out / ផ្លាស់ប្តូរ )

រូបថត Facebook

អ្នក​កំពុង​បញ្ចេញ​មតិ​ដោយ​ប្រើ​គណនី Facebook របស់​អ្នក​។ Log Out / ផ្លាស់ប្តូរ )

Google+ photo

អ្នក​កំពុង​បញ្ចេញ​មតិ​ដោយ​ប្រើ​គណនី Google+ របស់​អ្នក​។ Log Out / ផ្លាស់ប្តូរ )

កំពុង​ភ្ជាប់​ទៅ​កាន់ %s