コード例 #1
0
ファイル: Program.cs プロジェクト: rycle/TaxCalculator
 public static void Main(string[] args)
 {
     TaxManager manager = new TaxManager();
     Console.WriteLine("Input bruto salary: ");
     UInt32 salary;
     if (!UInt32.TryParse(Console.ReadLine(), out salary))
     {
         throw new ArgumentException("Parsing user input: bruto salary.");
     }
     Single sum = manager.CalcTax(salary);
     Console.WriteLine("Tax'd with {0} and the result salary is {1}", sum, salary - sum);
 }
コード例 #2
0
        public static void Main(string[] args)
        {
            TaxManager manager = new TaxManager();

            Console.WriteLine("Input bruto salary: ");
            UInt32 salary;

            if (!UInt32.TryParse(Console.ReadLine(), out salary))
            {
                throw new ArgumentException("Parsing user input: bruto salary.");
            }
            Single sum = manager.CalcTax(salary);

            Console.WriteLine("Tax'd with {0} and the result salary is {1}", sum, salary - sum);
        }