Advertisement
Dh111

Untitled

Oct 22nd, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication5
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. double amount;
  13. int county;
  14. double tax;
  15. double salestax;
  16. double totaldue;
  17.  
  18. Console.WriteLine("Enter purchase amount:");
  19. amount = Convert.ToDouble(Console.ReadLine());
  20. Console.WriteLine("Enter county code:");
  21. county = Convert.ToInt32(Console.ReadLine());
  22. while ((county >= 5) && (county <= 30))
  23. {
  24. if (county <= 8)
  25. {
  26. tax = 0.05;
  27. }
  28. else if (county >= 8 & county <= 20)
  29. {
  30. tax = 0.06;
  31. }
  32. else
  33. {
  34. tax = 0.07;
  35. }
  36. salestax = amount * tax / 100;
  37. totaldue = amount + salestax;
  38.  
  39. Console.WriteLine("Sales tax = ", salestax);
  40. Console.WriteLine("Total due = ", totaldue);
  41.  
  42. Console.WriteLine("Press enter to continue ...");
  43. Console.ReadLine();
  44. }
  45. }
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement