-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new file: CSHarp/BudgetAndBilling.cs
- Loading branch information
Ray nieva
authored and
Ray nieva
committed
Jun 24, 2017
1 parent
81e00de
commit 74f4365
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.