Skip to content

Commit

Permalink
new file: CSHarp/BudgetAndBilling.cs
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 81e00de commit 74f4365
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions CSHarp/BudgetAndBilling.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System;

public class MyProgram
{
public static void Main(String[] args)
{
// 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");
double income1;

input(out 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?
}

// .NET can only read single characters or entire lines from the console.
// The following functions are designed to help input specific data types.
// 'out' is a pass-by-reference modifier in C#.

private static void input(out double result)
{
while (!double.TryParse(Console.ReadLine(), out result));
}

private static void input(out int result)
{
while (!int.TryParse(Console.ReadLine(), out result));
}

private static void input(out Boolean result)
{
while (!Boolean.TryParse(Console.ReadLine(), out result));
}

private static void input(out string result)
{
result = Console.ReadLine();
}
}
Empty file added CSHarp/BudgetAndBilling.cs~
Empty file.

0 comments on commit 74f4365

Please sign in to comment.