Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Text;
- namespace ConsoleApplication5
- {
- class Program
- {
- static void Main(string[] args)
- {
- double amount;
- int county;
- double tax;
- double salestax;
- double totaldue;
- Console.WriteLine("Enter purchase amount:");
- amount = Convert.ToDouble(Console.ReadLine());
- Console.WriteLine("Enter county code:");
- county = Convert.ToInt32(Console.ReadLine());
- while ((county >= 5) && (county <= 30))
- {
- if (county <= 8)
- {
- tax = 0.05;
- }
- else if (county >= 8 & county <= 20)
- {
- tax = 0.06;
- }
- else
- {
- tax = 0.07;
- }
- salestax = amount * tax / 100;
- totaldue = amount + salestax;
- Console.WriteLine("Sales tax = ", salestax);
- Console.WriteLine("Total due = ", totaldue);
- Console.WriteLine("Press enter to continue ...");
- Console.ReadLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement