using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace amount_of_tax_owed{ class Program { //main method static void Main(string[] args) { //promt user to enter gross pay Console.Write("Enter the gross pay: "); //read gross Pay double grossPay = double.Parse(Console.ReadLine()); double taxPay = 0; // gross pay of 100000 or less, the tax is 0% if (grossPay < 100000) { taxPay = 0; } //for over 100000 and 300000 or less, the tax rate is 15% if (grossPay > 100000 && grossPay < 300000) { taxPay = 0.15 * grossPay; } // any pay over 300000, the tax rate is 28% if (grossPay > 300000) { taxPay = 0.28 * grossPay; } //show Tax pay Console.WriteLine("Tax pay : $" + taxPay.ToString()); //delay Console.ReadLine(); } }}
Comments