Answer to Question #45294 in C# for Nikita Maheshwari

Question #45294
Develop the program, which accepts the gross pay and produces the amount of tax owed. For a gross pay of 100000 or less, the tax is 0%; for over 100000 and 300000 or less, the tax rate is 15%; and for any pay over 300000, the tax rate is 28%. Calculate tax pay and return the result to main method. Print the result in main method.
1
Expert's answer
2014-08-28T05:42:16-0400
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();
}
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS