0% found this document useful (0 votes)
38 views2 pages

Program: Using Using Using Using Namespace Class Static Void String Float Float Int

This C# program calculates tax amounts for employees based on their annual income. It prompts the user to input an employee ID and details like basic pay, deductions, allowances, and calculates their gross pay, net salary, annual income. Based on the annual income amount, it determines the tax amount by applying different tax rates and displays the output.

Uploaded by

NISHA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views2 pages

Program: Using Using Using Using Namespace Class Static Void String Float Float Int

This C# program calculates tax amounts for employees based on their annual income. It prompts the user to input an employee ID and details like basic pay, deductions, allowances, and calculates their gross pay, net salary, annual income. Based on the annual income amount, it determines the tax amount by applying different tax rates and displays the output.

Uploaded by

NISHA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

using System;

using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace tax
{
class Program
{
static void Main(string[] args)
{
float gp, bs, da, hra, eid, pf, pt, ded, ns, daamt, annual;
float aic, tax;
Console.WriteLine("Enter the employee id:");
eid = int.Parse(Console.ReadLine());

Console.WriteLine("Enter the employee basic pay:");


bs = int.Parse(Console.ReadLine());
Console.WriteLine("Enter the employee da:");
da = int.Parse(Console.ReadLine());
Console.WriteLine("Enter the HRA:");
hra = int.Parse(Console.ReadLine());
daamt = bs * da / 100;
gp = bs + daamt + hra + da;
Console.WriteLine("Enter the gross pay:" + gp);
Console.WriteLine("Enter the PF:");
pf = int.Parse(Console.ReadLine());
Console.WriteLine("Enter the PT:");
pt = int.Parse(Console.ReadLine());
ded = pf + pt;
Console.WriteLine("Deduction:" + ded);
ns = gp - ded;
Console.WriteLine("Net salary:" + ns);
aic = ns * 12;
Console.WriteLine("Annual income:" + aic);
annual = aic - 250000;
if (annual <= 250000)
{
Console.WriteLine("no tax");
}

else if ((annual > 250000) && (annual < 350000))


{
tax = annual * 10 / 100;
Console.WriteLine("your tax amount:" + tax);
}
else if ((annual > 350000) && (annual < 450000))
{
tax = annual * 15 / 100;
Console.WriteLine("your tax amount is:" + tax);
}
else
{
tax = annual * 25 / 100;
Console.WriteLine("your tax amount is:" + tax);

}
Console.ReadKey();

You might also like