Skip to content

Commit

Permalink
new file: VB.NET/BudgetAndBilling.vb
Browse files Browse the repository at this point in the history
  • Loading branch information
Ray nieva authored and Ray nieva committed Jun 24, 2017
1 parent 96a7b87 commit e28e742
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions VB.NET/BudgetAndBilling.vb
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Imports System

Public Module MyProgram
Sub Main
' This program is intended to be used to calculate my weekly budget based on income that week and projected expenses that week.
Console.WriteLine("Calculating Weekly/ Budget")

' This is usually weekly (net) income but can be another period like bi-weekly or monthly
Console.WriteLine("Get Income for week/period")
Dim income1 As Double

input(income1)

' At this point start inputting billing items. These are essentially billing items for the current week or period.
' The question is at this point what direction this program will go? Will there be permanently assigned billing items or billing items adhoc defined each week. Can Flowgorithm define a true OO approach?
End Sub

' .NET can only read single characters or entire lines from the console.
' The following functions are designed to help input specific data types.

Private Sub input(ByRef result As Double)
While Not Double.TryParse(Console.ReadLine(), result)
' No code in the loop
End While
End Sub

Private Sub input(ByRef result As Integer)
While Not Integer.TryParse(Console.ReadLine(), result)
' No code in the loop
End While
End Sub

Private Sub input(ByRef result As Boolean)
While Not Boolean.TryParse(Console.ReadLine(), result)
' No code in the loop
End While
End Sub

Private Sub input(ByRef result As String)
result = Console.ReadLine();
End Sub
End Module

0 comments on commit e28e742

Please sign in to comment.