Venciity

[Jumpstart C#] Console HMWRK - Price

Jan 31st, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Price
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.Write("Price= ");
  14.             decimal price = Decimal.Parse(Console.ReadLine());
  15.             decimal vat = price * 0.2m;
  16.  
  17.             int columWidth = -12;
  18.  
  19.             Console.WriteLine("{0,-12}{1,10:C}", "Price:", price);
  20.             Console.WriteLine("{0,-12}{1,10:C}", "VAT(20%):", vat);
  21.             Console.WriteLine("----------------------");
  22.             Console.WriteLine("{0,-12}{1,10:C}", "Total:", price + vat);
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment