Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 21st, 2012  |  syntax: None  |  size: 1.04 KB  |  hits: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Module Module1
  2.  
  3.     Sub Main()
  4.         Console.Title = "Penny-A-Day"
  5. st:
  6.         Console.WriteLine("Penny-A-Day")
  7.         Console.WriteLine("-----------------")
  8.         Console.WriteLine("How many days?")
  9.         Dim days As String = Console.ReadLine()
  10.  
  11.         If (IsNumeric(days)) Then
  12.             days = Integer.Parse(days)
  13.             Dim penny As Double = 0.01
  14.             Dim days2 As Integer = 1
  15.             Do While days2 <= days
  16.  
  17.                 If days2 = 1 Then
  18.                     penny = 1 * penny
  19.                     days2 += 1
  20.                 Else
  21.                     penny = 2 * penny
  22.                     days2 += 1
  23.                 End If
  24.  
  25.  
  26.             Loop
  27.             Console.Clear()
  28.             Console.WriteLine("After " + days + " days, You would have $" & penny)
  29.             Console.WriteLine("")
  30.             GoTo st
  31.  
  32.         Else
  33.             Console.Clear()
  34.             Console.WriteLine("Error: Not a number.")
  35.             Console.WriteLine("")
  36.             GoTo st
  37.         End If
  38.     End Sub
  39.  
  40.  
  41. End Module