In: Computer Science
PLEASE DO THIS IN C#.In 1789, Benjamin Franklin is known to have written “Our new Constitution is now established, and has an appearance that promises permanency; but in this world nothing can be said to be certain, except death and taxes.” Our federal tax system is a “graduated” tax system which is broken into seven segments. Essentially, the more you make, the higher your tax rate. For 2018, you can find the tax brackets here. Your task is to design (pseudocode) and implement (source code) a program that asks the user for a salary and calculates the federal tax owed. Note, that only the money above a particular tax bracket gets taxed at the higher rate. For example, if someone makes $10,000 a year, the first $9525 gets taxed at 10%. The “excess” above that ($475) gets taxed at 12%. Note: work through at least three (3) examples of this by hand before designing the code. It will save you significant time. Still having problems? Have you talked to a GTA recently? Sample run 1: Enter your salary to the nearest dollar: 2000 Total tax owed is: $200
using System;
public class Test
{
public static void Main()
{
double tax = 0;
Console.WriteLine("Enter your
salary to the nearest dollar: ");
double salary =
Convert.ToDouble(Console.ReadLine());
if(salary <= 10000)
tax = salary*0.1;
else
tax = salary*0.1 +
(salary-10000)*0.12;
Console.WriteLine("Total tax owed
is: $"+tax);
}
}
Output:
Enter your salary to the nearest dollar: 2000 Total tax owed is: $200
Do ask if any doubt. Please upvote.